关于JS异步刷新
1.页面上显示新的请求页面 页面请求:javaScript:onlink(url); 2.js脚本 function createXMLHttpRequest(){ if(window.ActiveXObject){ try { request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { request = false; } }else{ //其他浏览器 xmlHttp = new XMLHttpRequest(); } }
function onshow(){ if(xmlHttp.readyState==4){ if(xmlHttp.readyState==200){ var info = xmlHttp.responseText; doucment.getElementById("iframe").innerHTML = info; } } }
function onLink(url){ createXMLHttpRequest(); xmlHttp.open("post",url,true); xmlHttp.onreadyStatechage = onshow(); xmlHttp.send(null); }