Reputation: 7917
The following code is working correctly on localhost, but not on the server. I think 'confirm' is a kind of plugin function.
var ask = confirm('Are you sure');
if (ask){
$('.loading_gif').show();
$('.delete_link').hide();
return true;
}
else{
return false;
}
I want to use some built-in function to do same thing. How can I do this?
Thank you
Upvotes: 0
Views: 141
Reputation: 16440
confirm
should be standard JavaScript library function.
if it's not working on the server, check the following
Upvotes: 1
Reputation: 50767
confirm
is a javascript method to provide a prompt with an ok, or cancel button (browser dependent i think). the if(ask)
statement checks to see if ask = true
, when the cancel prompt's ok button
is clicked, it returns true
to the function, if cancel button is clickd
, false returns. This is not a problem with the scope of this function.
Upvotes: 1