Placing content in a .js file

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 26, 2022   (RSS)

By MercerDesign - October 25, 2022

I am building a site that has background images that are controlled from a .js file, so my question is; how do I place the image upload code in the .js file instead of in the .php file? I have attached the .js file and the area that I need to change is on line 174.

Attachments:

splitex.js 11K

By Dave - October 26, 2022

Sorry, correction.  You want to name the file with a .js.php ending, so splitex.js.php.  

This will have the server execute it as PHP code, but because your sending the javascript header the browser will interpret it as javascript code.

Dave Edis - Senior Developer
interactivetools.com