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 $
.
精彩评论