Hello.
I write ajax page request and I can't make split of java.
Please add me responseText.split(||javascript||) like this
this is my sode
I want it for work javascript in contain page. ThanksCode:var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no) var loadstatustext="<center><br><br><br><br><br><img src='pic/ajax-loader.gif' /><br><br><br></center>" var loadingPanel = new yuiLoadingPanel(); function load(){ loadingPanel.show(); } function deload(){ loadingPanel.hide(); } ////NO NEED TO EDIT BELOW//////////////////////// var defaultcontentarray=new Object() var bustcacheparameter = "" function ajaxpage(page,where){ var page_request = false if (window.XMLHttpRequest) // if Mozilla, Safari etc page_request = new XMLHttpRequest() else if (window.ActiveXObject){ // if IE try { page_request = new ActiveXObject("Msxml2.XMLHTTP") } catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP") } catch (e){} } } else return false load(); var xmlhttp=false; //Clear our fetching variable try { xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object… } catch (e) { try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest } xmlhttp.open('GET', page, true); //Open the file through GET, and add the page we want to retrieve as a GET variable ** xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status == 200) { //Check if it is ready to recieve data var main_div = xmlhttp.responseText; //The content data which has been retrieved *** if(main_div){ //Make sure there is something in the content variable document.getElementById(where).innerHTML = main_div; //Change the inner content of your div to the newly retrieved content **** deload(); } } } xmlhttp.send(null) //Nullify the XMLHttpRequest return; }



Reply With Quote

Bookmarks