View Single Post
Old May 26th, 2006, 10:03 AM   #10
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Quote:
Originally Posted by dpsleep
im working with prototype.js and thickbox trying to insert the image data from http://software.hixie.ch/utilities/cgi/data/data into the js.i wanted to change
$("body").append("<div id='TB_load'><div id='TB_loadContent'><img src='pictures/circle_animation.gif' /></div></div>");
to
$("body").append('<div id='TB_load'><div id='TB_loadContent'><img src="image data" /></div></div>');

the only problem is the image data has a bunch of single quote marks in it.
anyone has an idea on what i should do here?
That's nowhere near the only problem. I have no idea what $("body") means, but I can guess you're trying to do something like this:
image = document.createElement("img");
image.src = "my_image.png";
image.alt = "Picture!!!11";

holder = document.createElement("div");
holder.id = "TB_load";
holder.appendChild(image);

body = document.getElementsByTagName("body")[0];
body.appendChild(holder);

Disclaimer: not tested - there's likely to be a bug or two.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote