/    Sign up×
Community /Pin to ProfileBookmark

refreshing a browser window onLoad?

Is it possible to do this in the body tag?

eg. <BODY onLoad=”(whatever code is to refresh browser window)”>

The page concerned is inside a frameset and i want to refresh the very top level.

Cheers,

Mcukedup

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JPnycSep 15.2004 — The page would constantly refresh unless you use a setTimeout. It would never just display. That would be a disaster. But of course you can call it onload. You can call most any function on most any event handler, provided the element you're calling it on HAS that event handler.
Copy linkTweet thisAlerts:
@ai3rulesSep 15.2004 — Here is a way to change the location.href adding a substring to the end of it after 1 change so that it only changes once. Is this something like what you are looking for? I wasnt exactly sure.

<script language="javascript">

<!--

function reloadPage(){

var strings = location.search.substring(1)

if(strings.indexOf('reloaded')!= -1){}

else{

location.href="reloadPage.htm?reloaded"

}

}

//-->

</script>

<body onload="reloadPage()">
×

Success!

Help @mcukedup 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...