On Apr 28, 8:21 am, torbein <[email protected]> wrote:
> Take a look athttp://kart.uit.no/andhttp://kart.uit.no/uit_markers.php
>
> There are some problems rendering the html. It comes out as plain
> text, not html...
>
> Any idea what I am doing wrong?

Your "content" variable within createMarker starts with &lt;b&gt; --
HTML requires that to be <b> if it's to be a bold tag. Currently, it's
outputting exactly what it's told to do: &lt; will result in a
character < being output, it doesn't introduce an HTML tag.

Either: don't encode your entities in the php (although you may need
to do this); or, if that doesn't work, you will need to decode them in
the Javascript.

Normally, entities are encoded because the text is contained within an
XML element, not an XML attribute. I suspect that it may not be
necessary to encode them for inclusion in an attribute.

Note too that this order:
$xmlStr=str_replace('<','&lt;',$htmlStr);
$xmlStr=str_replace('>','&gt;',$xmlStr);
$xmlStr=str_replace('"','&quot;',$xmlStr);
$xmlStr=str_replace("'",'&#39;',$xmlStr);
$xmlStr=str_replace('&','&amp;',$xmlStr);
will result in entities which have already been encoded getting their
& re-encoded:

"<" is replaced with "&lt;" and then the ampersand is replaced to give
"&amp;lt;"

Occasionally that's necessary -- in which case the ampersand
replacement should come right at the end, not half-way through -- but
here it may be part of the problem.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to