Results 1 to 2 of 2
Thread: Image display using AJAX
Aug 18, 2006, 11:52 #1
Image display using AJAX
I am writing a small AJAX based application in which I have to display an image dynamically. I am returning the image name from PHP using XML. is there any way I can display the image instead of the image name on HTML page? Should I return just image name or the fully qualifies ANCHOR Tag?
I would appreciate any help in this regard. Thanks in advance!!
Aug 18, 2006, 12:33 #2
- Join Date
- Nov 2004
- Nelson BC
- 0 Post(s)
- 0 Thread(s)
Once you have the image url you can create an image tag and append it to your document in the right place.
var myImageURL = "/images/clowns.gif" // this really comes from ajax call var myImage = document.createElement("img"); myImage.src = myImageURL; document.getElementById("someDIV").appendChild(myImage);