Solved

Position of javascript link and W3C xhtml compliance

Posted on 2010-09-05
6
391 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bootstrap Form 16 40
Tools for analysis of code 4 48
PHP: Filling Out/Creating a PDF 29 102
selected value 16 26
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

733 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