1

我正在尝试使用 YUI 3 在我们的应用程序中跟踪 jQuery 的性能。IE8 抱怨运行缓慢的脚本,在调试时它似乎是 jQuery 内部的(扩展函数)。

我已经设法让 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,这是导致问题的原因。

谢谢!

4

1 回答 1

1

registerFunction之后添加registerConstructor

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

参考

于 2013-11-15T03:06:26.080 回答