2012-08-07 52 views
1

我想使用YUI 3來跟蹤我們的應用程序中的jQuery的性能。 IE8抱怨緩慢運行的腳本,它在調試時似乎是jQuery(擴展功能)的內部。使用YUI 3來跟蹤jQuery.extend

我設法讓YUI跟蹤的jQuery的電話,但不是使用下面的代碼的擴展功能本身:

//create new instance and load profiler 
YUI().use("profiler", function(Y){ 

    Y.Profiler.registerConstructor("jQuery", window); 

    window.YProfiler = Y.Profiler; 
}); 

這追蹤到jQuery的特定電話,但不能jQuery.extend - 根據這到IE是造成這個問題。

謝謝!

回答

1

添加registerFunctionregisterConstructor

Y.Profiler.registerConstructor("jQuery", window); 
Y.Profiler.registerFunction("jQuery.extend"); 

參考