Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Having Trouble With Changing JS Links in Index.html

I have a website in which some javascript is used. At the bottom of index.html there is a section for the link source, (as seen here)

https://gyazo.com/aa66e1e1a10360b0a51f199c6284afb6

and I have a folder with the exact same Javascripts in my website's folder
(seen here)

https://gyazo.com/7804e640cff00d73e56d6f8236793b6d

All I want to do is change the javascript sources to the ones in my js folder, but for some reason it won't work when I replace it with just "js/myfile.js" I would like to do this so I could upload my website files to multiple domains, so the source won't be domain specific like it currently is now.


If anyone understands this and could help, that would be greatly appreicated, or if more information is needed let me know.

Thank you much for your time.✌
"but for some reason it won't work"

Try to narrow it down. Check if it's a directory problem: open the page with the inspect element tool and try to open the link of the javascript files in a new tab.
First figure out if it's a problem with the directory or the CSS. Does it work if you take it out of the js folder back into public_html then embed it as myfile p.js? (wherever your index is)

If not then it's a problem with the CSS
If yes it's a problem with the directory and instead of just using /js/myfile.js try the full directory as public_html/js/myfile.js or mywebsite.com/public_html/js/myfile.js
~
If you're linking it as "js/myfile.js" then you have to be sure that you're not currently in what the website or browser recognizes as a directory.
If your current URL looks like "http://site.com/search/" then when it tries to resolve the file, it'll look for "http://site.com/search/js/myfile.js"

Make sure to set permissions for your js files correctly, so the web user isn't denied access from trying to view them.
(Feb 3, 2018 03:19 PM)kickball34 Wrote:  i'm gonna get your ip address and rat your pc.
I believe it is a problem with the CSS, not the directory. I have tried many different solutions to the directory, (listed above) and also some other ones with help from someone who knows basic html and javascript. I am wondering what should I do now knowing it is a problem with the css?
If you're attempting to link just the JS files, it won't be an issue with your CSS.
Try settings it from the directory root:
/js/myfile.js which will make a request to example.com/js/myfile.js regardless of the folder you're currently located in.
(Feb 3, 2018 03:19 PM)kickball34 Wrote:  i'm gonna get your ip address and rat your pc.
I have tried that. And it still wont work. I was wondering if anyone could help me on Teamview or skype


Possibly Related Threads...
Thread / Author Replies Views Last Post
by ZanDeviousJun 30, 2018 08:55 PM 6 232 Jun 30, 2018 08:55 PM
Last Post: Two-Ton 21
by S U-R-O YOct 12, 2017 11:48 AM 2 164 Oct 12, 2017 11:48 AM
Last Post: Rushax
by SeiferAug 19, 2017 01:04 PM 2 284 Aug 19, 2017 01:04 PM
Last Post: Seifer