Solved

Position of javascript link and W3C xhtml compliance

Posted on 2010-09-05
6
387 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:ncw
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
grantunwin earned 400 total points
ID: 33607301
Yes. I just tested it at:

http://validator.w3.org
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 33607314
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
 
LVL 1

Author Comment

by:ncw
ID: 33607438
I just seem to remember that it caused me an error last time. I'll try it out.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:ncw
ID: 33607456
Is there anyway to hide the javascript from view source?
0
 
LVL 15

Assisted Solution

by:Insoftservice
Insoftservice earned 100 total points
ID: 33609004
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
 
LVL 1

Author Closing Comment

by:ncw
ID: 33640936
As you say it works fine, thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now