在一个网页中显示另一个网页
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=gb2312"> <style type="text/css"> #linkdiv{ width:400px; height:300px; background:yellow; } </style> <script type="text/javascript"> var xmlHttp; function createXmlHttp() { if (window.XMLHttpRequest) xmlHttp = new XMLHttpRequest(); else xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } function update() { if(xmlHttp.readyState == 4) { results = xmlHttp.responseText; linkdiv.innerHTML=results; } } function send(linkurl) { createXmlHttp(); xmlHttp.onreadystatechange = update; xmlHttp.open("get",linkurl, true); xmlHttp.send(null); } </script> </head> <body> <a href='javascript:send("http://www.baidu.com")'>www.baidu.com</a> <a href='javascript:send("http://www.google.cn")'>www.google.cn</a> <div id="linkdiv"> </div> </body> </html>
http://zhidao.baidu.com/question/54938455.html