Ickyb0d
01-08-2007, 05:07 PM
I know this may not be completely "Javascript" but i think the JS people on here would have a better understanding of the problem than someone in any of the other forums... with that said...
I'm currently creating "dynamic" images by passing a query string (mainly just a stringified JSON object) as the url for the source of an image. For instance...
var img = document.createElement("img");
img.src = "create_image_script.pcgi?values={ "x1" : 50, "y1" : 25, "width" : 500, ... }
document.getElementById("image_area").appendChild(img);
Which works completely fine, but for a longer and more complex object, this doesn't work as the string gets too long and gets truncated and breaks my script. My question is - is there any possibly way to generate this using a form to submit the data, as opposed to a query string?
Since javascript can't actually access the binary data of the image (right...?) i can't just make a form, return the binary data for the image, and set the source to that. I was contemplating making a form that would redirect to an image... or something after it was submitted with the data, but i'm not quite sure how that would work. Anyways, any insight or help would be greatly appreciated! thanks!
I'm currently creating "dynamic" images by passing a query string (mainly just a stringified JSON object) as the url for the source of an image. For instance...
var img = document.createElement("img");
img.src = "create_image_script.pcgi?values={ "x1" : 50, "y1" : 25, "width" : 500, ... }
document.getElementById("image_area").appendChild(img);
Which works completely fine, but for a longer and more complex object, this doesn't work as the string gets too long and gets truncated and breaks my script. My question is - is there any possibly way to generate this using a form to submit the data, as opposed to a query string?
Since javascript can't actually access the binary data of the image (right...?) i can't just make a form, return the binary data for the image, and set the source to that. I was contemplating making a form that would redirect to an image... or something after it was submitted with the data, but i'm not quite sure how that would work. Anyways, any insight or help would be greatly appreciated! thanks!