I'm having a weird problem. I'm using some javascript functions to do client side encryption for a login form. Everything works perfectly when I have the javascript copied out between script tags in the header, but when I do an external link to the file with the exact same code, it doesn't work at all. I've used javascript before and haven't encountered this problem, and i can't seem to figure out what is different in this page that could be interfering. The script is in a file called encrypt.js in the same folder...I literally can copy and paste it between the script tags and it works...it's mostly MD5 encryption functions, and a function for doing CHAP login authentication (I didn't write it, borrowed from an internet tutorial, but I do understand how it works). I have the same problem in Firefox and IE 7, and I've tried changing the order of the attributes or removing some in the script tag but it didn't make a difference.
Absolutely sure. I've tried it on both my dedicated server and also on my computer, where i can clearly see they are in the same folder. If I type in the url for the javascript file it comes up in the browser where it should be.
I figured it out by testing each part of the code to see what made the file fail. It was one line of code that had a <?php ?> tag in it, which i didn't realize because i copied parts of the code from a tutorial and they used external links. it makes sense that the external file wouldn't know what to do with the php part.