I have created a
PHP version of my webpage, and it finds my external css just fine. However, I cannot get it to load the external
JS code and I can’t figure out why that is. I am using WinSCP to connect to a server.
I know that PHP is server-side, and technically, the JS is also on the server right? In my code, I link the css down to the root folder, and it comes back in the PHP version of the webpage. But JS won’t. I have searched for quite some time on how to make this work, and perhaps it doesn’t.
It should be working. Load the php script in a browser. Right click,
Inspectand go to
Console. (But I guess you should know how to go to the console already.)
If it mention anything about a
404, the file doesn’t exist or you’re not putting the correct url in the
If it’s not, please comment the error in the console. If there isn’t any, the script was loaded, but you don’t realize it somehow.
Edit: Also, maybe your mime type is wrong, if the above doesn’t work, try replacing