codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How can I detect a websites page source code?  chengcj at 12:38 on Monday, May 08, 2006
 

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?

  Re: How can I detect a websites page source code?  miteshbhimjiyaani at 14:03 on Tuesday, May 16, 2006
 

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>









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  IE Only comeback
•  Re: java app auto web update..
•  ` Error Code 64: Host not available ` - Error when accessing ASP Appln
•  Re: dynamic crystal report generation
•  Launch an app remotely through a website
•  Run an app in my pc from another pc
•  a:hover elements
•  Rearranging elements in a table
•  window.open giving http404 error


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007