Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing a div.

Status
Not open for further replies.

McKaulick

Programmer
Oct 24, 2002
35
AR
Hello, I have a div on my page that looks like that:

<div id="rightBg">
<? include("stat.php"); ?>
</div>

I want to refresh this DIV.

This does not work:

<!-- <javascript> -->
function refreshDiv(myDiv) {
//alert('I see this');
curDiv = document.getElementById(divID);
curDiv.refresh();
}
<!-- </javascript> -->

Any help would be much appreciated.

Thanks

McKaulick
 
It doesn't work because [tt]refresh()[/tt] is not a member function for that object.

There are a number of options... the simplest would be to include an [tt]iframe[/tt] inside your [tt]div[/tt] and then reload the contents of the [tt]iframe[/tt].

Otherwise you'll need to do some reading about asynchronous javascript and xml (AJAX apparently) and use that to fire off a http request to the server and populate the [tt]innerText[/tt] property of the [tt]div[/tt].

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Enable Apps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top