开发者

How to define a jQuery object with noConflict()?

Is it possible to define an object $response without the $?

My code will look something like this:

jQuery.get("test.pl", { action: "开发者_开发问答getNextID" }, function(data) {
  var $response = jQuery(data);
});


there's no functional difference between $response and response. $ in jQuery is nothing magic, just a reference to jQuery; also, using $variable in jQuery script is nothing more then a pattern which denotes jQuery object-likeys.


you can call it whatever you wish. the $ prefix is usually just a convention to denote which objects are of the jquery wrapper type (to differentiate them from DOM elements/primitive types). Makes life a bit easier, but won't have any affect on whether you have noConflict() on or not


$response is just a variable name that happens to start with a $. It has nothing to do with jQuery. You can call the variable anything you like - with or without a $.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜