Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-14-2010, 06:13 AM   PM User | #1
arsalan660
New to the CF scene

 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
arsalan660 is an unknown quantity at this point
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.
arsalan660 is offline   Reply With Quote
Old 12-14-2010, 09:40 AM   PM User | #2
arsalan660
New to the CF scene

 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
arsalan660 is an unknown quantity at this point
I think I have asked a difficult one.

Please only tell how to get a data from a table having class. Only for Firefox
arsalan660 is offline   Reply With Quote
Old 12-14-2010, 08:11 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,198
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
??? 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.
Old Pedant is offline   Reply With Quote
Old 12-17-2010, 12:45 PM   PM User | #4
arsalan660
New to the CF scene

 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
arsalan660 is an unknown quantity at this point
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.
arsalan660 is offline   Reply With Quote
Old 12-17-2010, 07:18 PM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,198
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 12-18-2010, 04:20 PM   PM User | #6
arsalan660
New to the CF scene

 
Join Date: Dec 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
arsalan660 is an unknown quantity at this point
Thanks but Refresh not working. page is not refreshing
arsalan660 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:38 AM.


Advertisement
Log in to turn off these ads.