By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,939 Members | 1,670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,939 IT Pros & Developers. It's quick & easy.

Javascript and Confirm

P: n/a
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

Oct 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

On Oct 13, 4:11 pm, caroline.doi...@gmail.com wrote:
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
Oct 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.