gpt4 book ai didi

javascript - 使用 YUI 3 跟踪 jQuery.extend

转载 作者:行者123 更新时间:2023-11-28 02:46:02 24 4
gpt4 key购买 nike

我正在尝试使用 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 的说法,这是导致问题的原因。

谢谢!

最佳答案

registerConstructor之后添加registerFunction:

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

引用文献

关于javascript - 使用 YUI 3 跟踪 jQuery.extend,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11855350/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com