Javascript and Confirm

C

caroline.doidge

This is a weird one and I am wondering if someone can help?

I have a piece of Javascript
function deleteRequest(searchID) {
if (confirm('Are you sure?')){
location = "index.php?spDB=inactive&searchID="+searchID;
}
}

When the page gets reloaded, it runs a database query and something is
made inactive.

The problem is:
When the confirm box appears, if I press OK quickly, the database query
doesn't happen. If I wait 1 second and then press OK, it is fine and
the query is run.

Basically it appears that the time between the confirm javascript
appearing and the time taken to press the Ok button affects the
reloading of the page.

Has anyone else had an issue like this?

Cheers for anyones help.
Caroline
 
U

uoL

hi caroline,

That's quite weird .. have you tried to use window.location =
"something"; instead of location=''";
is the only things that comes to my mind right now.

take care,
marcos.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top