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?

Improve company productivity with a Business Account.Sign Up

x
 
grantunwinConnect With a Mentor Commented:
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
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?
0
 
InsoftserviceConnect With a Mentor Commented:
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.