Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
html validation problems when using javascript
Old 12-28-2006, 09:14 PM html validation problems when using javascript
blackhawkpowers's Avatar
Ultra Talker

Posts: 313
Name: Dustin
Location: GA
Trades: 0
I'm having some problems validating my site and I'm not exactly sure how to fix it but all the validation errors are in my javascript. if you could shed any light on any of these errors it would be greatly appreciated.

HTML Code:
Line 103, column 36: character ";" not allowed in attribute specification list . 
var origMsg = '<font color="#A6A6A6"; face="Times New Roman, Times, serif"> 
 
Error Line 104, column 25: document type does not allow element "br" here . 
var msg1 = 'Style 600<br/>This cap has a split visor, 
 
Error Line 149, column 28: character ";" not allowed in attribute specification list . 
for (x=0; x<dynimages.length; x++){
 
__________________
A patch is a piece of software which replaces old bugs with new bugs.

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by blackhawkpowers; 12-28-2006 at 09:16 PM..
blackhawkpowers is offline
Reply With Quote
View Public Profile Visit blackhawkpowers's homepage!
 
 
Register now for full access!
Old 12-29-2006, 01:29 AM Re: html validation problems when using javascript
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I think for the first error (line 103) you just need to remove the semicolon after setting the color attribute. You wouldn't have the semicolon there in html which I believe is what's causing the validation issue.

I'm thinking line 104 it's one of two things. First <br/> should be <br /> with the space before the /

If that's not it you might need to use double quotes instead of the single quotes. If you need the single quotes then you probably need to escape the < / > characters.

I'm not sure about the last one. I get the feeling even though it points to that line of code the error is really somewhere else. I've also noticed that sometimes fixing an error in an earlier line of code fixes a lot of the errors in later lines of code.

Hope some of what I said helps and actually works.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-30-2006, 05:46 AM Re: html validation problems when using javascript
Ultra Talker

Posts: 256
Location: Auckland, New Zealand
Trades: 0
What I don't understand is why is the HTML validator, is validating your Javascript, this would be excluded from the parser, so I believe you have not correctly placed it within the script element.

Is it possible to see the site? That way I could give you a definite answer to solve this problem as for the first error it's self explanatory, you don't have semi-colons in the attributes of elements, unless it's within the attribute's value.

The second error, should not matter if there's a space after br, this was just for older browsers who did not understand XHTML properly. Now a br element can not sit alone in the body element, it must appear within another element, it's most likely you've just got it sitting alone, not within an element.

The third error, the validator again should not be interpretting this at all, something is wrong with your HTML.

Cheers,

MC
__________________
#------------------------------signature---------------------------------------------------------------------------------#
Quote:
I am well recognised for what I don't do than what I do. Chores are just one of those things.
mastercomputers is offline
Reply With Quote
View Public Profile Visit mastercomputers's homepage!
 
Reply     « Reply to html validation problems when using javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12269 seconds with 12 queries