Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    glz
    glz is offline
    New Coder
    Join Date
    Apr 2007
    Posts
    57
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Unhappy A way to dynamically view a live source of a .html page??

    Many ajax and javascript functions change the innerHTML of elements in the source, writing and rewriting things in the source

    You can run any javascript function or action you want that would change the source, but when you view it, it will always show the original source before a JS function changed it

    Is there a way to view the changed source after each time a JS functoin changes it??

    for example:
    <span id="whatever">This is the original source code</span>

    then you may run this piece of JS:
    whatever.innerHTML= 'Changed source code!';


    but when you right click and press 'view source"
    you will always get this:
    <span id="whatever">This is the original source code</span>

    I want to get the changed source code, maybe its possible to write the changed source code to another file, or use some kind of HTTP prog to read the changes on an html page???

    Any help appreciated thanks

  • #2
    eak
    eak is offline
    Regular Coder eak's Avatar
    Join Date
    Jun 2002
    Location
    Nashville, TN
    Posts
    354
    Thanks
    0
    Thanked 26 Times in 26 Posts
    try this:
    Code:
    alert(document.body.innerHTML);
    eak | "Doing a good deed is like wetting your pants; every one can see the results, but only you can feel the warmth."

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    The Firebug plugin for FireFox does what you are looking for.


  •  

    Posting Permissions

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