Re: Can't figure this error out

Lou King <lking@knob.com>, 2010-03-18 14:30 -0400:

> http://www.knob.com/ATG/Calendar/venture.html
> 
> map.openInfoWindowHtml(map.getCenter(), "<img
> src='../jpg/Finian.jpg' width='64' height='80' alt='picture of
> Peter'><b>This is a picture of 951 Greene Street</b>");
> 
> As written the code works with all browsers I checked. The Goole
> Maps function openWindowHtml() gets 2 values; a point on the map and
> a string of HTML code which is the content of the balloon created.
> 
> The problem is that I can't figure out how to get the line to
> validate. The error is "end tag for element "B" which is not open"
> pointing at the last ">". If I change the closing tag to "/>" then
> it validates but what is displayed is "... Street/>". If I change it
> to "</" it still works but doesn't validate.

While that line is invalid with regard to the HTML4 spec, it's not
an error condition as far a processing in browsers is concerned
(as you note, it works as expected in all browsers you checked).
And it's intentionally not invalid in HTML5. So if you change your
doctype to <!doctype html> (to trigger validation against HTML5
instead of HTML4) and re-check your page, I think you should find
that it validates.

  --Mike

-- 
Michael(tm) Smith
http://people.w3.org/mike

Received on Thursday, 18 March 2010 18:54:08 UTC