Web Hosting Talk







View Full Version : fresh within div container (ajax)


ti_nhatrang
07-02-2007, 10:14 PM
Hi guys,

I'm currently using this for my refresh script, however, I don't want it to refresh the whole page, I just want it to refresh in a ajax DIV container...

is there anyway we can do this?

Here is my code:

<SCRIPT LANGUAGE="JavaScript">
<!---
var refreshID = "";
refreshID = setTimeout("DoRefresh()", <? echo ($timeout*1000); ?>);

function DoRefresh()
{
document.location.href = '<? echo $refreshURL; ?>';
}
//--->
</SCRIPT>

please help. :)

foobic
07-02-2007, 11:57 PM
Replacing content in a container (typically a div) is a common part of almost every AJAX application. Start with the w3schools tutorial (http://www.w3schools.com/ajax/default.asp)

arkin
07-04-2007, 04:11 AM
Whilst people will help you on WHT, there are rarely any that will provide full instruction or pre-written scripts for you to use.

With that said, I recommend trying to mootools.net AJAX framework, there are good tutorials and it will do exactly what you are after.

dezignwork
07-14-2007, 05:57 PM
Id recommend checking XAJAX framework if you use PHP. I am happy with it, although I would be interested to know if there is anything better.

ti_nhatrang
07-14-2007, 06:00 PM
wow, is there a book on this? it looks difficult..

dezignwork
07-14-2007, 06:16 PM
there is the documentation :)