SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast coolsaint's Avatar
    Join Date
    Jul 2005
    Location
    Dhaka, Bangladesh
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Dynamically created Tag

    Dear Friends,

    Html Tags like table or td can be dynamically created by javascript using javascript's document.write function. But if the Code of the script is called from outside or from the same using <script> codes... </script> and there are 1000s of conditional document.write statement which generates html tag based on different conditions How can I get what are the lines dynamically created by javascript? I mean for debuggin purpose i want to get the output of the javascript file actually which can't be found in right click-> view source.
    if i get the output source file including all the code (including the tags generated by javascript) that will be fine.

    Thanks.

    Coolsaint.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    See http://javascript.about.com/library/blsource.htm to get a bookmarklet that you can install into your browser that will display the source after the Javascript has run.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Web Developer Toolbar for Firefox does the same.

  4. #4
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The document.documentElement.innerHTML property will give you a 'live' html snapshot of your page in most browsers. It misses the doctype , but you can't change that with javascript anyhow.

  5. #5
    SitePoint Enthusiast coolsaint's Avatar
    Join Date
    Jul 2005
    Location
    Dhaka, Bangladesh
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you felgall, buddy bradly and mrhoo.

    All your ways work. But in my case I used the web Developer Toolbar.

    There is a option in the web Developer Toolbar called generated view source. I used that to get what is dynamically created.

    Thank you Guys.

    Coolsaint
    Last edited by coolsaint; Sep 22, 2006 at 11:23. Reason: Formatting


Bookmarks

Posting Permissions

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