且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JQuery:$ .get不是一个函数

更新时间:2023-11-20 23:14:40

$ 变量来自Prototype-js,因为您使用的是 jQuery.noConflict 方法。

The $ variable you have is from Prototype-js, because you are using the jQuery.noConflict method.

该方法将恢复 $ 变量回到第一个实现它的库。

That method will restore the $ variable back to whichever library first implemented it.

你应该直接在 jQuery 全局对象上使用jQuery方法,例如:

You should use the jQuery methods on the jQuery global object directly, eg.:

jQuery.get(/* .. */);
jQuery.getJSON(/* .. */);
// etc...

或者你可以定义另一个较短的变量作为别名想要:

Or you can define another shorter variable as alias if you want:

var $j = jQuery.noConflict();