|
Assume my homepage has a button and a textbox. When I press the button, the textbox would show the page source code of www.google.com (or any other web page source code)
Of course, I haven't got the page source code before hand, or else I can just copy and paste the page source code to the textbox...
Would you please tell me how to use javascript to do that?
|
|
|
hi
its work proper in mozilla
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function viewSource() {
var url=document.getElementById("url");
alert(url);
window.location.href= "view-source:" + url.value;
alert(window.location.href);
return false;
}
</script>
</HEAD>
<BODY>
<center>
Type in a full URL and click "View Source"
<br>
<br>
<input type=text id=url value="http://">
<br>
<br>
<input type=button onClick="return viewSource();" name=view value="View Source">
</center>
|
|
|
|
|
|
|
// |