Reputation: 14151
I have some javascript to set makers for google maps. Inside the markers I have links <a>link</a>
to display on the map.
Howver the W3C valdiator complains about the >
at the end of the opening <a>
. I have tried replacing it with >
but it complained about the &
.
Is there a way around this?
Thanks
["<a href='/thebrianboru'>The Brian Boru</a><br />5 Prospect R…
Upvotes: 3
Views: 107
Reputation: 719
You can use any of them below:
<script type="text/javascript">
<!--
YOUR JS CODE .........
alert("www.mykitchenroom.com");
// -->
</script>
OR,
<script type="text/javascript">
//<![CDATA[
YOUR JS CODE .........
alert("www.scienceanddevelops.com");
//]]>
</script>
W3C will don't check your code.
Thanks And Regards, Subhojit Mukherjee
Upvotes: 0
Reputation: 46657
If this is inside of a <script></script>
block in HTML, it could cause problems:
The script should not contain the sequence
</
because it could be confused with the</script>
. Inserting a backslash between < and / in strings avoids the problem.
<\/
http://javascript.crockford.com/script.html
Upvotes: 0
Reputation: 26730
Sounds like XHTML? Put the JavaScript in a CDATA section: http://en.wikipedia.org/wiki/CDATA to tell the interpreter, that it should ignore special characters like < > and &.
<script>
<![CDATA[
// ...
]]>
</script>
Upvotes: 0