0
$(function() {
$("#rv-title").click(function(event) {
$("#rv-content").toggle();
$.ajax({
url: 'index.php?route=check',
dataType: 'json',
success: function(json) {
if (json['output']) {
$('#cart .content').html(json['output']);
}
}
});
event.stopPropagation();
});
$(document).click(function(event) {
var a = $(event.target).andSelf().parents("#rv-content");
if (a.length == 0 && $("#rv-content").is(":visible")) {
$("#rv-content").toggle();
}
});
});
我的ajax函数在哪里,是放它的地方吗?jquery ajax里面的函数
感谢
在您看来,哪一个更有效? –
第二个,因为你可以多次调用my_ajax()函数。因为。再次写同样的想法是浪费时间。 – Gowri