Passing data from php to Jquery

前端 未结 6 2332
北恋
北恋 2020-12-21 19:44

I have all my javascript/jquery code in a file and include it into my page. Without having apache process js files as php what would be the best way to pass data from php to

6条回答
  •  春和景丽
    2020-12-21 20:26

    Why don't you just have php render javascript directly (as JSON), then you have it available to jQuery natively.

    
    

    Edit:

    if you don't want to have inline js in your php page, and don't want apache to process js as php, then maybe you can src a php file which contains js.

    
    
                                     
                  
提交回复
热议问题