Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Javascript 

Safari on iOS creates two confirm() boxes

I'm trying to figure out how to solve it.

I came across this: http://stackoverflow.com/a/11546344/266542

Seems pretty simple for an alert() box, but how would I return the value of the confirm to the function that calls the setTimeout()?
still lurkin. still bitcoin cashin.
(Jan 10, 2014 09:57 AM)Orgy Wrote:  I'm trying to figure out how to solve it.

I came across this: http://stackoverflow.com/a/11546344/266542

Seems pretty simple for an alert() box, but how would I return the value of the confirm to the function that calls the setTimeout()?

Declare the variable prior to the anonymous function.

Code
var userInput = false;

setTimeout(function () {
  userInput = confirm('Some prompt message');
}, 300);

Proof of concept:
[Image: 3ef92b9255d93c18bd38f1dcacbc9de1.png]
<Disease />
(Jan 11, 2014 12:17 PM)Disease Wrote:  Declare the variable prior to the anonymous function.

Code
var userInput = false;

setTimeout(function () {
  userInput = confirm('Some prompt message');
}, 300);

Proof of concept:
[Image: 3ef92b9255d93c18bd38f1dcacbc9de1.png]

Ah hello Disease. I think I tried that at some point and it didn't work for some reason. I don't know. This code I've been fixing up is so terrible.

I'll try this out in a moment to see if it does indeed fix the bug.

Is there any other way to return it other than setting a variable above it's scope?

Come on Skype man
still lurkin. still bitcoin cashin.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by MarkoTheHackerOct 29, 2024 08:56 PM 2 245 Oct 29, 2024 08:56 PM
Last Post: Clumsy
by InvictusProMar 23, 2024 07:56 AM 0 179 Mar 23, 2024 07:56 AM
Last Post: InvictusPro
[Javascript]  by CryptoLayerFeb 15, 2019 06:30 AM 5 200 Feb 15, 2019 06:30 AM
Last Post: DrDoof