Originally posted by Prabhakar Rao:
How the sites are displaying Dynamic content in HTML pages.
Suppose if we take index.html of rediff, each time you refresh the page it shows a different ad.
What does "of rediff" mean?
I agree with Bear and Ben. Displaying a different ad on a page everytime the page is loaded can be accomplished on the client side with simple javascript or it can be accomplished on the server side using a server side language like php or
servlets +
jsp.
But I need the actual process on
-how they put space for the dynamic content.
It sounds like you might need to learn some html as well. Web browsers render html in the order it appears on the page (although that order can be altered using css). Also, you can use css to make text on a web page flow around any sized image automatically, so the size of the image would be irrelevant.
-how they display dynamic content each time.
You populate an array with different .jpg files that are ads. When the request is received, you program the jsp or servlet to generate a random integer and assign it to a variable. You use that variable as the index value of the array, e.g.
myAds[myRanNum] and then you assign that specific .jpg file to the src attribute of an <img> tag, e.g.
out.println("<h1>My Web Page</h1>");
out.println("<img src=\"http://mysite.com/someDir/ads/" + myAds[myRanNum] + "\"/>");
out.println("<div>some text here</div>"); [ October 05, 2006: Message edited by: sven studde ]