/    Sign up×
Community /Pin to ProfileBookmark

Countdown Refresh Frame

I’m trying to code a page that puts my heading in the top frame of a page with two frames and does a countdown that refreshes the second frame every 30 seconds, and then either reloads the countdown and does it again, or simply refreshes both frames to start over. My current code doesn’t seem to be working:

[CODE]<html>
<head>
<title>Live Election Results</title>
<SCRIPT LANGUAGE=”JavaScript”>
var count = “5”
function countdown() {
if (count == “0”) {
parent.frames[“source”].location.reload()
}
else {
count = count – 1
setTimeout(“countdown()”, 1000)
}
}
countdown()
</SCRIPT>
</head>
<!– Frames are to be placed in the top of an –>
<!– HTML page BEFORE the BODY tag –>
<frameset rows=”20%,*” border=”0″>
<frame name=”heading_rfrsh” src=”head.htm” marginwidth=”10″ marginheight=”10″ scrolling=”auto” frameborder=”0″>
<frame name=”source” src=”http://www.mcvote.com/results/results_47.html” marginwidth=”10″ marginheight=”10″ scrolling=”auto” frameborder=”0″>
</frameset>
<body>
</body>
</html>[/CODE]

The point is that this web site posts live election counting results, but they don’t offer an XML or RSS feed to tap into. They do seem to update this page regularly on election day, and I’m too lazy to refresh that page ? over and over again. Is there an easy way to do this? Thanks.

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 12.2007 — Not if it is on a foreign domain. You cannot use javascript to cross domains. Once the frame has a page from a different domain, you lose the ability to script it. It is a security feature. Sorry. ?
Copy linkTweet thisAlerts:
@dz_boyauthorApr 12.2007 — I'm only trying the refresh that frame, and update the view of the page on a foreign domain. I don't need anything else other than a page which updates the data from that page every minute or so. Can't I refresh a frame that is on my domain?
Copy linkTweet thisAlerts:
@gil_davisApr 13.2007 — Once the frame contains a page form a foreign domain, it becomes tainted and you can't do anything with it. A frame is a window object and it follows its own security rules regardless of its apparent position.
Copy linkTweet thisAlerts:
@dz_boyauthorApr 13.2007 — Why is that? I don't see a security risk for simply refreshing [I]my[/I] view of their page... I'm not changing anything or even accessing anything on it! Can you think of a different way to do this that would work?
Copy linkTweet thisAlerts:
@gil_davisApr 13.2007 — Refreshing the whole frame might do it.
Copy linkTweet thisAlerts:
@dz_boyauthorApr 13.2007 — You mean just the frame containing the foreign source, or the entire page? Would there be a way to have it continuosly refresh every minute or so? Thanks so much for your help.
Copy linkTweet thisAlerts:
@gil_davisApr 13.2007 — Put this in your frameset:
&lt;meta http-equiv="refresh" content="60" /&gt;
×

Success!

Help @dz_boy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...