Hi, i’m playing around with trying to get some script off my pages and into some .js files if i’m using them on multple pages.
However, i’m experiencing two main difficulties.
1) If my .js file is to go into the header say, and it contains a function myFunction(). What’s the correct syntax to use in the html body to call that function? I thought it might be somethign like file.myFunction where file is the file.js, but i’m not having any luck with that.
2) When i use a very simple email hiding script
[code]
var myName = “someone”;
var myDomain = “host.com”;
document.write(‘<a href=”mailto:”+myName+”@”+myDomain’);
for some reason, when i load the page, subsequent scripts don’t work. in fact none of the html really seems to work…and it’s not the <!– –> comments, because i took them all out (obviously i realised that putting //–> in a .js file isn’t going to stop anything happening in the main html body – and also, any program not handling jscript isn’t going to load the .js file anyway) – so it’s not that. Any ideas…is this a syntactical thing?
Cheers
Al