使用typeof判斷function是否存在于上下文_javascript技巧
來源:懂視網
責編:小采
時間:2020-11-27 21:26:13
使用typeof判斷function是否存在于上下文_javascript技巧
使用typeof判斷function是否存在于上下文_javascript技巧:在窗口加載時,使用typeof判斷function是否存在于上下文 window.onload = function(){ try{ if(test && typeof(test) == function){ test(); } }catch(e){ alert(方法不存在); } } function test(){ al
導讀使用typeof判斷function是否存在于上下文_javascript技巧:在窗口加載時,使用typeof判斷function是否存在于上下文 window.onload = function(){ try{ if(test && typeof(test) == function){ test(); } }catch(e){ alert(方法不存在); } } function test(){ al

在窗口加載時,使用typeof判斷function是否存在于上下文
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
使用typeof判斷function是否存在于上下文_javascript技巧
使用typeof判斷function是否存在于上下文_javascript技巧:在窗口加載時,使用typeof判斷function是否存在于上下文 window.onload = function(){ try{ if(test && typeof(test) == function){ test(); } }catch(e){ alert(方法不存在); } } function test(){ al