www.webdeveloper.com
Results 1 to 4 of 4

Thread: view source

  1. #1
    Join Date
    Sep 2003
    Location
    PHILIPPINES
    Posts
    15

    view source

    hello and Good Day.

    may i know if there is a javascript function that will allow me to view the source of a page in a modal dialog? i'm having a problem with my page and i cant view the source.

    thanks for the help

  2. #2
    Join Date
    Feb 2004
    Posts
    36
    If you are using IE, there is a bug which prevents you from viewing source when the cache is full. Empty the cache (Internet Options, Temporary Internet files, Delete Files) and try again.
    Hope that helps.

  3. #3
    Join Date
    Sep 2003
    Location
    PHILIPPINES
    Posts
    15

    Wink just found a solution

    <script type="text/JavaScript">
    function viewSource() {
    window.location="view-source:" + window.location
    }
    </script>
    <button onclick="viewSource()" type="button">view</button>

    this would allow you to view source in a modal dialog.

  4. #4
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    Assuming the file in the new window is on the same domain and is in a variable called w, you should be able to do something along these lines:
    Code:
    alert(w.document.body.innerHTML);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles