: I want to write a program that dyanamically creates webpage taking an image and then add comment about the page
: And finally I want all these to be added in a single webpage where in onclick of next and previous buttons the pages are to be displayed with in the same page
:
: Please help me out in generating the code
: Also I want the path to be taken as a relative path
:
Here is a javascript function, which changes the image:
function changeImage(url)
{
imgSpanID.innerHTML = '<img src="'+url+'">';
}
The HTML that goes along with it is this:
<span id="imgSpanID"></span>
Place the HTML code anywhere where you want the image to be. You can modify the DHTML code the function creates as you wish. This can also be used to update the comment and to update the buttons.
A relative path is similar to a absolute path, but leaves certain parts out. So if you have your images located in a subfolder called "myimages" then you can call the function as follows:
changeImage('myimages/someimage.jpg');