开发者

jquery bug with firebug

I am using jQuery javascript framework and whenever i load pages with firebug it returns "$" as an anonymous() function in consol开发者_如何学Ce. Is there a way to fix it?

Thanks in advance.


Looks like jQuery was not loaded when you tried to call it. Try calling the object using jQuery instead of $ to confirm jQuery was actually loaded. Also, are you using other libraries like Prototype as well because they might be interfering with the $ object!! If yes, try using jQuery.noConflict().


I don't know why it happens, but yes I see it often too. Something about firebug interferes with the binding of the jQuery function to $ under some circumstance. You're probably aware it's just the firebug console that's bugging out ( $() in included scripts should be working as expected), but it's worth mentioning. Usually I have to reload the page, or even kill the tab.

I'd like to understand why it happens, but for now when it happens (assuming jquery really is loaded in the page) I found I can fix it in the console with:

$ = jQuery;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜