Problem with double quotes

M

Michel Couche

Hello,

I am learning the Google maps API.

I one test I made, I retrieve data from an XLM file and these are injected
via a JScript function into a HTML div tag.

The data are as follows:

XML file

<markers>
....
<marker stationname="XXX" lat="13.745346" lng="100.535073" category="R_IT"
htmltag="Set in the heart of one of Bangkok most prestigious and fashionable
areas, ....." />
</markersV

JScript function
.....
var htmltag = markers.getAttribute("htmltag");
var html = "<b>"+name+"</b><p style='font-family: Verdana, Arial, Helvetica,
sans-serif;font-size: 12px;color: #666699;'>"+htmltag+"</p>";
.....

When used as shown above, I have no problem, HTML code is injected into the
DIV tag as expected. However, I would like to start the htmltag element with
an image tag something like :
<markers>
....
<marker stationname="XXX" lat="13.745346" lng="100.535073" category="R_IT"
htmltag="<img src='Logos/anagarden.png' >Set in the heart of one of Bangkok
most prestigious and fashionable areas, ....." />
</markers>

The use of the image tag screws the page up. I tried the escape caracter,
doubling single or double quotes, ', ... no way to get my code working
(I do not receive error code either)

Thanks in advance for your support


Michel
 
E

EricW

Hi,

Try:

<marker stationname="XXX" lat="13.745346" lng="100.535073" category="R_IT"
htmltag=<img src='Logos/anagarden.png' >"Set in the heart of one of Bangkok
most prestigious and fashionable areas, ....." />
</markers>


I've moved the first quote to after the img markup.

rg,
Eric
 
M

Michel Couche

Thank you Eric for taking the time to look at my issue but the solution does
not solve the issue
Michel



EricW said:
Hi,

Try:

<marker stationname="XXX" lat="13.745346" lng="100.535073" category="R_IT"
htmltag=<img src='Logos/anagarden.png' >"Set in the heart of one of
Bangkok
most prestigious and fashionable areas, ....." />
</markers>


I've moved the first quote to after the img markup.

rg,
Eric



Michel Couche said:
Hello,

I am learning the Google maps API.

I one test I made, I retrieve data from an XLM file and these are
injected via a JScript function into a HTML div tag.

The data are as follows:

XML file

<markers>
...
<marker stationname="XXX" lat="13.745346" lng="100.535073"
category="R_IT" htmltag="Set in the heart of one of Bangkok most
prestigious and fashionable areas, ....." />
</markersV

JScript function
....
var htmltag = markers.getAttribute("htmltag");
var html = "<b>"+name+"</b><p style='font-family: Verdana, Arial,
Helvetica, sans-serif;font-size: 12px;color: #666699;'>"+htmltag+"</p>";
....

When used as shown above, I have no problem, HTML code is injected into
the DIV tag as expected. However, I would like to start the htmltag
element with an image tag something like :
<markers>
...
<marker stationname="XXX" lat="13.745346" lng="100.535073"
category="R_IT" htmltag="<img src='Logos/anagarden.png' >Set in the heart
of one of Bangkok most prestigious and fashionable areas, ....." />
</markers>

The use of the image tag screws the page up. I tried the escape caracter,
doubling single or double quotes, ', ... no way to get my code
working (I do not receive error code either)

Thanks in advance for your support


Michel

 
O

\(O\)enone

Michel said:
The use of the image tag screws the page up. I tried the escape
caracter, doubling single or double quotes, ', ... no way to get
my code working (I do not receive error code either)

I've no idea what the problem is, so here's a guess and a suggestion:

1. The guess: try escaping the quotes with a backslash \ character:

[...]htmltag="<img src=\'Logos/anagarden.png\' >[...]

2. The suggestion: if that doesn't fix it (or even if it does!), use Firefox
as your web browser (www.getfirefox.com) and install the Firebug extension
(www.getfirebug.com). This has (among many other things) an absolutely
fabulous JavaScript debugger, allowing you to view the script that's
executing, set breakpoints, watch and interrogate variables and HTML
elements and a thousand other things. I've been doing a lot of JavaScript
development lately and I simply wouldn't have been able to do it without
Firebug; it's one of the most impressive pieces of web development software
I think I've ever used. And no, I don't have any affiliation with either of
these products, I'm just a very happy user :)

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top