簡體   English   中英

jQuery捕獲QUnit.done

[英]jquery catching QUnit.done

如何從jquery.testHelper.js中捕獲QUnit.done https://github.com/jquery/jquery-mobile/blob/master/tests/jquery.testHelper.js

我試圖定義

QUnit.done = function ( failed, passed, total, runtime ) {  
    alert("test");  
 }

但這給了我“ Uncaught ReferenceError:未定義QUnit”

加載QUnit庫后,必須確保定義此定義。 另外,該函數采用一個參數,該參數是一個對象{ name, failed, passed, total }因此:

QUnit.done = function ( result ) {  
    alert(result.total);  
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM