<html>function a() { alert("aa"); }function b(){ a(); }<body onloud="b()"></body></html>退出a()函數的執行!
4 回答

慕容3067478
TA貢獻1773條經驗 獲得超3個贊
1.[self performSelector:@selector(函數名) withObject:nil afterDelay:5.0f]
條件:在uiviewController的主線程中
2.[NSTimerscheduledTimerWithTimeInterval:5.0f target:self selector:@selector(函數名) userInfo:nil repeats:NO];
在具體函數中,執行代碼,執行完畢以后調用NSTimer invalidate方法來銷毀timer
3.[NSThread sleepForTimeInterval:5.0f];
[要延遲執行的方法];
條件:主線程或者子線程都可

犯罪嫌疑人X
TA貢獻2080條經驗 獲得超4個贊
<html>
function a()
{ alert("aa"); }
function b()
{ a(); }
<body onload="window.setTimeout(b,5000);"></body>
</html>

郎朗坤
TA貢獻1921條經驗 獲得超9個贊
function a()
{ alert("aa"); }
function b()
{ setTimeout(a(),延遲時間); }
<body onloud="b()"></body>
- 4 回答
- 0 關注
- 1110 瀏覽
添加回答
舉報
0/150
提交
取消