Why isn't my JS file being referenced and used?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Why isn't my JS file being referenced and used?

Post by simonmlewis »

I'm moving all my main javascript to one external file.
The file is there.
Yet when I remove the full script from one of the include files, and the reference to it is in the index.php file, the javascript doesn't function.

If I put the script directly into the include page, it does work.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Why isn't my JS file being referenced and used?

Post by simonmlewis »

Bingo - after checking other external JS files, I didn't realised because it is in a JS file, you don't tag it with <script></script>.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply