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
window.stop() function
Old 12-05-2007, 10:10 AM window.stop() function
Experienced Talker

Posts: 32
Trades: 0
Hello there!

I have a problem. I need to create js function to confirm browser reload with confirm() function. I know i need to use function from title together with executecommand('Stop') for IE. This is for one admin panel that i'm creating (to confirm user delete etc.).

i tryed something like this:

function confirm(){
if (!confirm("Example"))
window.stop();
return false;
}

but it didn't work although it worked if i putted it directly to onload element (onload='javascript:window.stop();return false;') of a link tag.


Any help would be great.
lotar_vk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-05-2007, 02:26 PM Re: window.stop() function
Experienced Talker

Posts: 32
Trades: 0
Anybody???
lotar_vk is offline
Reply With Quote
View Public Profile
 
Old 12-05-2007, 02:52 PM Re: window.stop() function
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Why use window.stop() which isn't supported by IE?

http://psacake.com/web/iw.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-05-2007, 04:14 PM Re: window.stop() function
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Lotar, as far as I know, you cannot stop a reload in a consistent way on every browsers.

As Chris pointed, if the command is placed on a link, you can use the onclik property.
The onclick is always executed first, and if the function called return false, the href will not be followed.

Now, if a user clicks the reload button, I don't think you will be able to prevent it in a cross-browser javascript code.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 12-07-2007, 02:42 PM Re: window.stop() function
Experienced Talker

Posts: 32
Trades: 0
Thanks... i didn't know that "return false" would stop the href...
lotar_vk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to window.stop() function
 

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.15890 seconds with 12 queries