<html>
<head>
<script>
function clear() {
Source=document.body.firstChild.data;
document.open();
document.close();
document.body.innerHTML=Source;
}
</script>
</head>
<body onload=clear()>
Test
</body>
</html>
破解方法
把月老大的网页在本地打开,然后在浏览器的地址栏输入
javascript:
var xmlHttp =document.all
?new ActiveXObject("Msxml2.XMLHTTP")
:new XMLHttpRequest();
var callServer=function() {
var url =location.href;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
};
var updatePage=function() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
alert(response);
}
};
callServer();
禁止查看源码文件方法二
如果那个还嫌不够,再试试这段java代码
package com.test;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.apache.poi.hwpf.model.FileInformationBlock;
public class MyURL {
public static void main(String[] args){
try{
//设置要连接的url
URL url=new URL("http://www.sina.com");
//建立连接对象
HttpURLConnection httpconn=(HttpURLConnection)url.openConnection();
//获取输入流
InputStream is=httpconn.getInputStream();
BufferedReader br=new BufferedReader(new InputStreamReader(is));
//将返回信息写入输出文件/控制台
/*OutputStream os=new FileOutputStream("d:/mythml.html");
OutputStream os2=new FileOutputStream("d:/mythml2.html");*/
byte[] bs=new byte[1024];
int len;
String s;
while((s=br.readLine())!=null){
System.out.println(s);
}
br.close();
is.close();
// while((len=is.read(bs))>0){
// os.write(bs,0,len);
// os2.write(bs,0,len);
// }
//关闭输入输出流
// os.close();
// os2.close();
is.close();
}catch(Exception e){
e.printStackTrace();
}
}
}