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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Get Table Data from a Class

    Here is the Code of the Table

    Code:
    <table id="commentary" class="display commentary" width="100%">
    							
    	<tr class="oversummary"><td colspan="2">&nbsp;</td><td>
    
    		End of over 1 (13 runs) - fubar(13-1). 155 runs required from 19 overs. RR 13.00 RRR 8.16 <br/>F. Amjad 10 (4b) , C. Dowe 3 (1b) , S. Hadad 1-0-13-1
    	</td></tr>
    I want a code by which Bold text can be seen on a new window by clicking on a link and that window refreshes after 30 seconds.

  • #2
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think I have asked a difficult one.

    Please only tell how to get a data from a table having class. Only for Firefox

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,184
    Thanks
    75
    Thanked 4,340 Times in 4,306 Posts
    ??? which class???

    You mean "oversummary"?

    And what is the point of refreshing the popup every 30 seconds if the data in the main page has not changed?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes I mean oversummary

    This is commentary of a cricket match and it changes after sometime thats why I also want a popup which refresh and gets the latest info.

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,184
    Thanks
    75
    Thanked 4,340 Times in 4,306 Posts
    Hmmm....I don't know if this will work or not, but I guess you can try it.

    Creating the popup is easy:
    Code:
    <a target="WATCHER" href="watcher.html"
       onclick="window.open('','WATCHER','height=200,width=500,scrollbars=no,status=no');">
    click to open watcher window
    </a>
    Then the code for "watcher.html":
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function update( )
    {
        var here = document.getElementById("putItHere");
        var tbl = opener.document.getElementById("commentary");
        var rows = tbl.getElementsByTagName("tr");
        for ( var r = 0; r < rows.length; ++r ) {
            var row = rows[r];
            if ( row.className == "oversummary" ) {
                var cell = row.getElementsByTagName("td")[1]; // get the second td
                here.innerHTML = cell.innerHTML;
                setTimeout( update, 30000 ); // do this again in 30 seconds
                return;
            }
        }
        // if we get here, we couldn't find the cell in the opener:
        here.innerHTML = "<b>Data no longer available</b>";
    }
    </script>
    </head>
    <body onload="update()">
    <h2>Summary:</h2><br>
    <h3 id="putItHere"></h3>
    </body>
    </html>
    I'm not at all clear what the point in this is. If the opener window is closed, then the watcher window will no longer be able to get the summary. So why bother with the separate window? Just keep looking at the original information on the original page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #6
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks but Refresh not working. page is not refreshing


  •  

    Posting Permissions

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