File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes reloading div dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "reloading div dynamically" Watch "reloading div dynamically" New topic
Author

reloading div dynamically

Bhavin Sanghani
Ranch Hand

Joined: Dec 17, 2003
Posts: 67
Hi,

Based on user's selection, I want to show image(s) in particular div. I tried innerHTML and style.display = "". But this does not dynamically shows images in div.

Also, can we reload particular div after placing image in that using innerHTML?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Originally posted by Bhavin Sanghani:
I tried innerHTML and style.display = "". But this does not dynamically shows images in div.
Why would you think that would work? Try "block".

Also, can we reload particular div after placing image in that using innerHTML?
Yes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bhavin Sanghani
Ranch Hand

Joined: Dec 17, 2003
Posts: 67
How can it be done?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Which part? What code have you written so far?
Bhavin Sanghani
Ranch Hand

Joined: Dec 17, 2003
Posts: 67
Hi

I am trying following code. calling dropit() function onclick of image to show it in particular area of the page.


function dropit(imageName)
{

document.getElementById("container").style.display = "block";
document.getElementById("container").innerHTML = "<br><img src='" + imageName + "/>";
}


<table border="0">
<tr>
<td>
<tr>
<td align="center" valign="middle">
<div style="display:none;" id="container">

</div>
</td>
</tr>
</td>
</tr>
</table>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: reloading div dynamically
 
Similar Threads
javascript form validation
Firefox: appendChild is getting hanged
is it possible to count the number of lines in the div element?
JSP + Spring + Ajax
Show images dynamically from DB