469,344 Members | 6,396 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

Reverse Solidus (Backslash) Necessary?

I am using strict HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
in my website. validator.w3c.org gives me lots of errors within my javascript code, such as:
'<B>a</B>...Line 24, Column 40: end tag for element "B" which is not open'

The validator does not recognize the start tag <B>, just the end tag </B>.

I have 4 possible fixes for this problem:
1. Back off to the provisional HTML (but why bother? - browsers work just fine with my code.)
2. Add the reverse solidus (backslash \) to the javascript end tags by replacing </ with <\/ in the javascript portions of my HTML (javascript treats "\/" just like "/". I'm not eager to do this - I have hundreds of pages of code, and I mix HTML with javascript on the same pages.)
3. Put the javascript in a separate file (again , I don't want to do this because of all the extra work.)
4. Ignore the validation errors (isn't this just a result of a buggy validator not recognizing the start tags?)

Is there a downside to ignoring the validation errors? Please let me have your thoughts.
Feb 8 '12 #1
1 1538
Dormilich
8,652 Expert Mod 8TB
validator.w3c.org gives me lots of errors within my javascript code, such as:
'<B>a</B>...Line 24, Column 40: end tag for element "B" which is not open'
then it's best to move the script to an external file and include it. this way it is never touched by the HTML parser/validator.
Feb 8 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

35 posts views Thread by Raymond Hettinger | last post: by
3 posts views Thread by Terry Asher | last post: by
11 posts views Thread by Neo | last post: by
10 posts views Thread by zahy[dot]bnaya[At]gmail[dot]com | last post: by
19 posts views Thread by Alan J. Flavell | last post: by
1 post views Thread by =?ISO-8859-1?Q?Tor_Erik_S=F8nvisen?= | last post: by
7 posts views Thread by Gui | last post: by
1 post views Thread by Chris Rebert | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.