How to write the php code in js file

前端 未结 4 485
猫巷女王i
猫巷女王i 2021-01-03 07:23

Is my program i divide the pages as a div in the first div i added this code

  

        
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-03 07:40

    Save the file as .php instead of .js and add

    Header("content-type: application/javascript");
    

    . at the beginning of the file. After that you will be able to link to the file as

    
    

提交回复
热议问题