2012-08-07 54 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"); 

参考