aspose 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


Win a copy of Spring in Action this week in the Spring forum!
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: 61433
    
  67

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: 61433
    
  67

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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reloading div dynamically