Pass JSON from php to javascript

前端 未结 4 1941
走了就别回头了
走了就别回头了 2020-12-11 07:46

I want to localize my webapp. Since localization through javascript only is not recommended I thought using php would be an alternative.

So with php I read a m

4条回答
  •  感动是毒
    2020-12-11 08:35

    You use array syntax [], or dot syntax ., to access javascript object properties.

    Example:

    localeObj["extTitle"];
    localeObj.extTitle;
    

    I would recommend reading something like this to get more familier with JSON.

提交回复
热议问题