This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 63198
    
  69

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: 63198
    
  69

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: reloading div dynamically
 
It's not a secret anymore!