This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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


Win a copy of Android Security Essentials Live Lessons this week in the Android 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: 60822
    
  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: 60822
    
  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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reloading div dynamically
 
Similar Threads
JSP + Spring + Ajax
is it possible to count the number of lines in the div element?
javascript form validation
Firefox: appendChild is getting hanged
Show images dynamically from DB