confirm box or alert box need twice click

I recently install safari on my Window XP System. I use it to visit a web site,if there is a button can popup a confirm box,I need to click[OK] twice to close it. Then I write a HTML page with javascript to test it.


when I write the javascript function confirm() or alert() in the onload() event,it works well,click once and it's closed.


but when I write the javascript function confirm() or alert() in a button click event, I need to click twice to close it.


I think it's a bug, and I have no idea to deal with it.


By the way,My safari version is 5.0.4


How to fix it? anybody who can help me?

Posted on Apr 21, 2011 8:07 PM

Reply
5 replies

Apr 21, 2011 10:41 PM in response to Carolyn Samit

Dear Carolyn,thanks for your reply.

but, our customer don't want to update the safari version recently.



anybody who is interesting in this problem can run the simple program just by opening the html file by safari.

create a file named test1.html

CODE:

<html>

<body onload="confirm('OK?');">

</body>

</html>

test result: It works well, the confirm box is clicked once and closed.


create a flie named test2.html

CODE:

<html>

<body>

<input type="button" value="test" onclick="confirm('ok')" />

</body>

</html>

test result: the confirm box need click twice to close.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

confirm box or alert box need twice click

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.