view-source without reload the page

Discussion in 'Javascript' started by micchy, Jan 16, 2004.

  1. micchy

    micchy Guest

    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
    micchy, Jan 16, 2004
    #1
    1. Advertising

  2. "micchy" <> wrote in message
    news:...
    >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)


    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.
    Richard Cornford, Jan 16, 2004
    #2
    1. Advertising

  3. micchy

    winnie hui Guest

    winnie hui, Jan 19, 2004
    #3
  4. micchy

    Evertjan. Guest

    micchy wrote on 16 jan 2004 in comp.lang.javascript:
    > 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)


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

    <br>

    <a href="#"
    onclick="w=window.open('');
    w.document.body.innerText=document.body.outerHTML.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)
    Evertjan., Jan 19, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Beall
    Replies:
    26
    Views:
    219,872
    AndreiKaa
    Jun 29, 2007
  2. gen_tricomi
    Replies:
    2
    Views:
    722
    gen_tricomi
    May 23, 2006
  3. Parthiv Joshi
    Replies:
    1
    Views:
    641
    Samuel L Matzen
    Jul 6, 2004
  4. andspal

    Updates in Design view not moved to Source view

    andspal, Nov 2, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    168
    andspal
    Nov 2, 2006
  5. Stefan Mueller
    Replies:
    4
    Views:
    278
    Stefan Mueller
    Nov 5, 2005
Loading...

Share This Page