hey.
i hav a file, suppose, name.php. it contains various things with a <div id="ajax-content">
another file is name_ajax.php
i use these codes to load contents from name_ajax.php in name.php's DIV
actually i use it for an ajax pagination system.Code:var xmlHttp function pagination(page) { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="name_ajax.php?starting="+page; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("ajax-content").innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject() { var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
btw, in name_ajax.php there are some javascript code. & they r not working when loaded in name.php's DIV area
thats the problem JS is not working when loaded via ajax
plz help me
ps: sorry for bad english & im not an expert JS coder



Reply With Quote


Bookmarks