I had some code that worked wonderful when it was inline. When I moved it to an external JS file, it stopped working and I cannot figure out why. So hopefully one of the bright people here can find my mistake.
I’m using jQuery and echoing the header of the webpage out via a PHP script, like so:
Perhaps there’s some mod_rewrite jiggery-pokery going on? Best thing is to do view-source with Firefox. See if the <script> tags are there. Then click the src links, and see if the correct JS appears. If not, then you know there’s a problem with where it’s located.
I have no clue why this works for me (on this one site), but if I break down and use an absolute path in my src, it works for some reason.
It’s strange, goes against all I thought I knew regarding sourcing…
For some reason this site I’m puttering on is a frigging path nightmare (only responds to absolute, except the line before which uses a relative. WTF?), but maybe that’ll work for you too.
Yeah, one of the first things I did was to check the page source. The script tags are most definitely being displayed correctly. Clicking on the src links loads the JS. So, yeah, I’m not sure what’s up with this.