view-source without reload the page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • micchy

    view-source without reload the page

    Dear everyone,

    I'd like to know if 'view-source' in javascript can work without
    reloading the page. (or not calling the page again, just as I
    right-click in IE)

    Thanks for your help!

    micchy
  • Richard Cornford

    #2
    Re: view-source without reload the page

    "micchy" <micchy@yahoo.c om> wrote in message
    news:bff98f60.0 401152239.2dcec c4c@posting.goo gle.com...[color=blue]
    >I'd like to know if 'view-source' in javascript can work
    >without reloading the page. (or not calling the page again,
    >just as I right-click in IE)[/color]

    There is no "view-source" in JavaScript so what you are doing must be
    some scripted attempt to view some source or another. But without seeing
    how you are going about this it is impossible to see why it is reloading
    the page or how it could be done differently to avoid that.

    The wild speculation would be that it is the usually failing to return
    false from the code within an onclick attribute of a line with a "#"
    HREF.

    Richard.


    Comment

    • winnie hui

      #3
      Re: view-source without reload the page

      Richard,

      Thanks for your help! I am trying to make use of this:




      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Evertjan.

        #4
        Re: view-source without reload the page

        micchy wrote on 16 jan 2004 in comp.lang.javas cript:[color=blue]
        > I'd like to know if 'view-source' in javascript can work without
        > reloading the page. (or not calling the page again, just as I
        > right-click in IE)[/color]

        <a href="#"
        onclick="locati on.href='view-source:'+locati on.href">
        View-source</a>

        <br>

        <a href="#"
        onclick="w=wind ow.open('');
        w.document.body .innerText=docu ment.body.outer HTML.replace(/</g,'\n<')">
        View-body</a>

        [be(a)ware of extra linebreaks]

        --
        Evertjan.
        The Netherlands.
        (Please change the x'es to dots in my emailaddress)

        Comment

        Working...