B2theRandino / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

setTimeout doesn't delay, happens right away #242

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  <div style="height:100px; width:100px; background-color:red;" 
onclick="setTimeout(alert('Wait five seconds'), 5000)">Test</div>

What is the expected output? What do you see instead?

Expect it to wait 5 seconds but it happens instantly.

What version of the product are you using? On what operating system?

0.4 Release 2
Tested with iPhone and Firefox (iPhone user agent string) 

Please provide any additional information below.

Original issue reported on code.google.com by mike%mic...@gtempaccount.com on 26 Apr 2010 at 2:54

GoogleCodeExporter commented 8 years ago
Weird.  Why do you think iUI is causing this problem?

Original comment by msgilli...@gmail.com on 26 Apr 2010 at 6:54

GoogleCodeExporter commented 8 years ago
I guess this has nothing to do with iUI. It has to do with the way alert is 
being called. In your test case,modify and  try this:
<div style="height:100px; width:100px; background-color:red;" 
onclick="setTimeout(alertMe(), 5000)">Test</div>
and add a function in javascript that executes alert like :
function alertMe(){
   alert('Wait five seconds');
}
and you should notice that it will call function alertMe after 5 seconds. Hope 
that should help.

Note: I have not verified it against latest iUI 0.4 Release 2

Original comment by variamay...@gmail.com on 5 Oct 2010 at 11:52