gheroonnpp
سه شنبه 12 اردیبهشت 1391, 23:46 عصر
با عرض سلام و تشکر از همه دوستان و...
سوال من اینه:
چطور میشه سورس یک سایت رو توسط جاوا اسکرییت خوند؟؟؟
دوستان من این کد رو تست کردم ولی فقط فایل های کنار خودش رو خوند
من می خوام از رو HTTP بخونه مثلا سورس گوگل و
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
<html lang='en'>
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<title>Get Source</title>
</head>
<body>
<h1>Get Source</h1>
<p>If javascript enabled, here is the source of this page:</p>
<div id="srcHere"></div>
<script type="text/javascript">
// assume modern browser
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET",document.URL, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
source = xmlhttp.responseText;
srcHere = document.getElementById( "srcHere" );
// replace all & with & so that all entities will be visible
source = source.replace(/&/g,"&");
// replace all < with < so that all tags will be visible
source = source.replace(/[<]/g,"<");
srcHere.innerHTML = "<code><pre>" + source + "<\/pre><\/code>";
}
}
xmlhttp.send(null)
</script>
</body>
</html>
سوال من اینه:
چطور میشه سورس یک سایت رو توسط جاوا اسکرییت خوند؟؟؟
دوستان من این کد رو تست کردم ولی فقط فایل های کنار خودش رو خوند
من می خوام از رو HTTP بخونه مثلا سورس گوگل و
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
<html lang='en'>
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<title>Get Source</title>
</head>
<body>
<h1>Get Source</h1>
<p>If javascript enabled, here is the source of this page:</p>
<div id="srcHere"></div>
<script type="text/javascript">
// assume modern browser
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET",document.URL, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
source = xmlhttp.responseText;
srcHere = document.getElementById( "srcHere" );
// replace all & with & so that all entities will be visible
source = source.replace(/&/g,"&");
// replace all < with < so that all tags will be visible
source = source.replace(/[<]/g,"<");
srcHere.innerHTML = "<code><pre>" + source + "<\/pre><\/code>";
}
}
xmlhttp.send(null)
</script>
</body>
</html>