Click here to Skip to main content
Licence 
First Posted 12 Sep 2005
Views 46,222
Bookmarked 14 times

View Source of ShowModalDialog

By | 12 Sep 2005 | Article
How to View Source of a window opened using ShowModalDialog

Introduction

Simple problem ... During web development, how do you View Source of a window spawned using ShowModalDialog?

In the webpage <HEAD> section add this javascript:

<script language="javascript">
   function viewSource()
   {
      d=window.open();
      d.document.open('text/plain').write(document.documentElement.outerHTML);
   }
</script>

Then, anyplace in your <BODY> add the following HTML

<input type=button value="View Source" onclick="viewSource()">


Yeah, I know. Really Simple. But took me almost an hour of searching to figure it out.


Enjoy

=============== Editor: Please trash below ==================

The CodeProject wizard wants more words. Apparently, a code article must have at least 100 words or the wizard doesn't think it contains enough important information. But unfortunately, this sample is very quick and easy to understand so no more words are necessary. Meaning I gotta fill up the 100 word limit with this trash (smile) maybe the editors will remove this trash before the article get's published

=============== Editor: Please trash above ==================

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

FlashMerlot

Web Developer

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralGracias PinmemberHomoplato21:51 14 Jul '09  
GeneralThanks PinmemberinkcolorYui0:56 20 Jul '07  
GeneralReally good script PinmemberBlackDalamar9:32 8 Mar '07  
GeneralThanks Saved me time Pinmembermstul01s4:13 5 Jan '07  
GeneralThis is Great PinmemberTonyv7516:20 21 Sep '06  
GeneralWhy not just open the window regularly Pinmemberdaddion2:10 13 Sep '05  
GeneralRe: Why not just open the window regularly PinmemberFlashMerlot6:15 13 Sep '05  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 12 Sep 2005
Article Copyright 2005 by FlashMerlot
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid