Can't load xml params with &?
In my xml markers file, I read an image http url parameter from the xml
file into a variable img1.
URL such as:
http://getmypic/image.pl?&a=12&Lon=-87.73&lat=31.47&W=500&H=500
Code as:
var img1 = markerElements[i].getAttribute("img1");
BubbleHtml[i] += "<br/><img src=\""+img1+"\"><br/>";
It turns out, if there is an & in the img XML tag the code stops
loading the rest of the xml stream. It will load up to THAT record,
but NOT that record. I've removed the &s and pointed it elsewhere it
works great. I add the & I lose that record and all records afterwards.
This is a new error to me as inside the javascript, I've hard coded
urls to grab the image of that location and it works fine.
var getPicUrl =
"http://getmypic/image.pl?&a=10&Lon="+point.x+"&lat="+point.y+"";
Now I'm just trying to pass the same line in via the xml parameter.
Any idea why & is a special character? I tried loading an escape
character \ in front of it and it didn't fly either.
No JS errors, just doesn't load.
Thanks
0 Comments:
Yorum Gönder
<< Home