Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Button to stop page load
Old 01-13-2010, 11:23 PM Button to stop page load
Junior Talker

Posts: 2
Trades: 0
I have a html web page, let's say A, that redirects to another page B. I've put some banners on page A that might interest the visitors. They are put there purposefully. I need a button that will allow the visitors of page A to stop page loading, thus stop the redirection to page B. When they press the button, another button will appear with the label "Continue to page B" which, when clicked, will continue to page B.
srk999 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-14-2010, 05:18 PM Re: Button to stop page load
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Show us the code you're working with.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-15-2010, 06:02 PM Re: Button to stop page load
Junior Talker

Posts: 2
Trades: 0
Found the solution.

Just in case some one else needs it, here it is:

Quote:
function redirect() {
//"assign" a new location
location.assign("pageB.htm");
}
function cancel() {
//cancel the timer
clearTimeout(timer);
}
var timer = setTimeout("redirect()", 10000);

the value is the number of milliseconds (1000 milliseconds = 1 second) you want before the redirect happens.

also, you need to code the button to cancel:
(put this somewhere on your page)
(note: replace "STOP!" with the text you want them to see)

<form>
<input type="reset" value="STOP!" onClick="cancel()"/>
</form>
srk999 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Button to stop page load
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27018 seconds with 12 queries