J
jmDesktop
I have searched much but cannot find answer to this seemingly simple
question. I have a function that builds an html element like this,
which works fine:
document.getElementById("message").innerHTML
+=
"<br>" + (i + 1) + ": <a
href='javascriptlace("
+ p[1] + "," + p[0] +
")'>" + result.Placemark.address + "</
a>";
I have changed it to this:
document.getElementById("message").innerHTML
+=
"<br>" + (i + 1) + ": <a
href='javascriptlace("
+ p[1] + "," + p[0] + ",'" + o.id + "','" +
result.Placemark.address +
"')'>" + result.Placemark.address + "</
a>";
There is a single quote on either side of o.id and result..., if you
cannot tell ", ' ". But this single quote never gets built. I have
tried \, escape(), String.charFromCode(39) with eval, and other
things. It just breaks the href up and what gets generated is:
<a href="javascriptlace(42.415392,-71.110948,"
ctl00_contentplaceholder1_formview1_mytextbox="" ,="" 127="" main=""
st,="" medford,="" ma="" 02155,="" usa="" )="">
and this translates to:
javascriptlace(42.415392,-71.110948, Why is it dropping after the
comma?
It should be:
javascriptlace(42.415392,-71.110948,'ctl00_contentplaceholder1_formview1_mytextbox','127
main st, medford, ma')
It is turnning the o.id and result.Placemark.address in to
variables, and I cannot figure out why. I want to pass them as
strings to another function.
I am using Firefox 3. Thank you for any help.
question. I have a function that builds an html element like this,
which works fine:
document.getElementById("message").innerHTML
+=
"<br>" + (i + 1) + ": <a
href='javascriptlace("
+ p[1] + "," + p[0] +
")'>" + result.Placemark.address + "</
a>";
I have changed it to this:
document.getElementById("message").innerHTML
+=
"<br>" + (i + 1) + ": <a
href='javascriptlace("
+ p[1] + "," + p[0] + ",'" + o.id + "','" +
result.Placemark.address +
"')'>" + result.Placemark.address + "</
a>";
There is a single quote on either side of o.id and result..., if you
cannot tell ", ' ". But this single quote never gets built. I have
tried \, escape(), String.charFromCode(39) with eval, and other
things. It just breaks the href up and what gets generated is:
<a href="javascriptlace(42.415392,-71.110948,"
ctl00_contentplaceholder1_formview1_mytextbox="" ,="" 127="" main=""
st,="" medford,="" ma="" 02155,="" usa="" )="">
and this translates to:
javascriptlace(42.415392,-71.110948, Why is it dropping after the
comma?
It should be:
javascriptlace(42.415392,-71.110948,'ctl00_contentplaceholder1_formview1_mytextbox','127
main st, medford, ma')
It is turnning the o.id and result.Placemark.address in to
variables, and I cannot figure out why. I want to pass them as
strings to another function.
I am using Firefox 3. Thank you for any help.