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?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

grantunwinConnect With a Mentor Commented:
Yes. I just tested it at:

May i know whats the w3 validator has given u an issue.
It will work only if u provide the perfect path to it.
ncwAuthor Commented:
I just seem to remember that it caused me an error last time. I'll try it out.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

ncwAuthor Commented:
Is there anyway to hide the javascript from view source?
InsoftserviceConnect With a Mentor Commented:
But y u want to hide it.
whats the validator issue ur getting.
i don't think is there any way to hide it.
ncwAuthor Commented:
As you say it works fine, thanks.
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.