Position of javascript link and W3C xhtml compliance

I can add javascript anywhere within the html of a web page between tags <script language="javascript" type="text/javascript"> and </script> but can I move the javascript to a .js file and add a reference to the file within the html eg:  
<script src="includes/javascript/images.js" type="text/javascript"></script>
will this work if it's outside the head tags, and if so will it pass a W3C xhtml compliance test?
LVL 1
ncwAsked:
Who is Participating?
 
grantunwinCommented:
Yes. I just tested it at:

http://validator.w3.org
0
 
InsoftserviceCommented:
Hi,
May i know whats the w3 validator has given u an issue.
It will work only if u provide the perfect path to it.
0
 
ncwAuthor Commented:
I just seem to remember that it caused me an error last time. I'll try it out.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ncwAuthor Commented:
Is there anyway to hide the javascript from view source?
0
 
InsoftserviceCommented:
HI,
But y u want to hide it.
whats the validator issue ur getting.
i don't think is there any way to hide it.
0
 
ncwAuthor Commented:
As you say it works fine, thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.