Validating Google Maps

Discussion about any web related scripting languages like JavaScript, ASP, and PHP.
User avatar
Lou
Rank V - Professional
Rank V - Professional
Posts: 276
Joined: Fri Jul 29, 2005 5:55 pm
Location: CO
Contact:

Re: Validating Google Maps

Post by Lou » Mon Mar 22, 2010 11:01 am

Code: Select all

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>");
From the w3c, www-validator Community form I got this reference http://www.htmlhelp.com/tools/validator ... tml#script which says about HTML in Script in part
...end tags are recognized within SCRIPT elements, but other kinds of markup--such as start tags and comments--are not. This is an unintuitive quirk of SGML for elements defined to have CDATA content.

Authors should avoid using strings such as "</P>" in their embedded scripts. In JavaScript, authors may use a backslash to prevent the string from being parsed as markup:
So this works cleanly.

Code: Select all

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>");
Lou
Say what you will about Sisyphus. He always has work.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Validating Google Maps

Post by Albert Wiersch » Mon Mar 22, 2010 11:21 am

Lou wrote:So this works cleanly.

Code: Select all

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>");
Thanks Lou... that's even "cleaner". :D

But I still think it is best to use external script files whenever possible.
Image
Albert Wiersch

User avatar
Lou
Rank V - Professional
Rank V - Professional
Posts: 276
Joined: Fri Jul 29, 2005 5:55 pm
Location: CO
Contact:

Re: Validating Google Maps

Post by Lou » Mon Mar 22, 2010 11:50 am

Albert Wiersch wrote:But I still think it is best to use external script files whenever possible.
I agree if there was more script to this. I think in this case the overhead of the serial file calls out weights the elegance of an external file.

Sense the "offending" script contains actual data there is no advantage of reuse and I keep thinking about the board member that uses dial-up; any overhead is a drag.

All goes to show why it is hard for a cat to keep its skin. (More than one way to skin a ...)
Lou
Say what you will about Sisyphus. He always has work.

Post Reply