egrissom
04-12-2007, 12:55 AM
I'm about ready to eat a box of poison. I'm dynamically creating images through the DOM with createElement, and when I get to the src attribute i need to set it to a url with a querystring attached (example someurl.aspx?item1=yes&item2=yes - the aspx page sends back an image). When the code is appended to the container div- the source is always &item2=yes. Its taking the "&" and converting to &.
I then tried to use createTextNode, and while the & was in tact for a bit- as soon as I setAttribute, it's converted. I even tried setting an Id to the image, then after the fact grabbing the id with getElementById() and changing the src.
innerHTML does the same thing, whatever i pass in, encodeURI() or otherwise, is always converted. Anyone have any idea at all what I might be able to do? The only thing i can think of that would work is document.write(), but I don't even know if i can specifically target a div with that.
anyone out there feel like talking me off the roof?
I then tried to use createTextNode, and while the & was in tact for a bit- as soon as I setAttribute, it's converted. I even tried setting an Id to the image, then after the fact grabbing the id with getElementById() and changing the src.
innerHTML does the same thing, whatever i pass in, encodeURI() or otherwise, is always converted. Anyone have any idea at all what I might be able to do? The only thing i can think of that would work is document.write(), but I don't even know if i can specifically target a div with that.
anyone out there feel like talking me off the roof?