Possible Duplicate:
jQuery ajax() vs get()/post()
jQueryAjax()和jQueryget()之间有什么区别?当用户单击链接时,哪一个能更好地从div的url中加载数据?
get
is just a shorthand to ajax
(a wrapper with some predefined properties). So use the one more handy for you in this particular case.
From the docs for the jQuery.get()
(docs) method.
This is a shorthand Ajax function, which is equivalent to:
$.ajax({
url: url,
data: data,
success: success,
dataType: dataType
});
From the jQuery manual jQuery.get()
is equivalent to
$.ajax({
url: url,
data: data,
success: success,
dataType: dataType
});
In other words, get()
is just a higher level alternative.
The answer is neither. If you want to load HTML directly into a div, the simplest way is to use .load:
jQuery('#divID').load(url);
It doesn't get any easier than that.