How to add ajax into joomla? - Joomla! Forum - community, help and support
i put in javascript
i put in tmpl file
it never refresh... tried use php file, cant work. copied code internet. how make working?
code: select all
function ajax()
{
var xmlhttp;
try
{
xmlhttp=new xmlhttprequest();// firefox, opera 8.0+, safari
}
catch (e)
{
try
{
xmlhttp=new activexobject("msxml2.xmlhttp"); // internet explorer
}
catch (e)
{
try
{
xmlhttp=new activexobject("microsoft.xmlhttp");
}
catch (e)
{
alert("no ajax!?");
return false;
}
}
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readystate==4)
{
document.getelementbyid('reloadthis').innerhtml=xmlhttp.responsetext;
settimeout('ajax()',500);
}
}
window.onload=function()
{
settimeout('ajax()',500);
}
}
i put in tmpl file
code: select all
<div id="reloadthis">
...
</div>
it never refresh... tried use php file, cant work. copied code internet. how make working?
Comments
Post a Comment