我想通過AJAX調用將一些數據加載到PHP腳本,然後將其返回,bla bla bla。那麼,它工作得很好,直到jScrollPane不會重新加載AJAX調用。我簡直不明白爲什麼,因爲我已經在$ .ajax調用的成功部分中調用了它......但是哦,不知道。看看下面的代碼,告訴我我做錯了什麼/如何解決它。jScrollPane和AJAX
function eventLink(){
jQuery(".ticket-link a").fancybox({
width:710,
height:750,
type:"iframe",
transitionIn:"elastic",
transitionOut:"elastic",
speedIn:600,
speedOut:600,
easingIn:"easeInExpo",
easingOut:"easeOutExpo",
overlayShow:true,
hideOnOverlayClick:false,
hideOnContentClick:false,
overlayOpacity:0.8,
overlayColor:"#000",
showCloseButton:true,
titleShow:true,
centerOnScroll:true
});
}
function scrollPane() {
jQuery('.scroll-pane').jScrollPane({
showArrows: true,
autoReinitialise: true
});
}
jQuery(document).ready(function(){
jQuery("select[name='sortby']").change(function(){
var a=jQuery(this).val();
jQuery.ajax({
type:"GET",
url:"ticket_order.php",
data:"sortby="+a,
beforeSend:function(){
jQuery("#ajax-loader").show();
jQuery("#ticket-list").hide(200);
jQuery("#ticket-list").empty()},
complete:function(){
jQuery("#ajax-loader").hide();
eventLink();
},
success:function(a){
jQuery("#ticket-list").html(a);
jQuery("#ticket-list").show(200);
scrollPane();
}
});
return false});
eventLink();
scrollPane();
});
嗯,似乎沒有工作。 AJAX現在沒有意義放棄數據。 'api = jQuery(「#ticket-list」)。data('jsp'); api.getContentPane()。html(a);' 這看起來合乎邏輯,但現在它不會將數據放入#ticket-list:/ – techouse 2011-12-26 12:14:02
奇怪的是'console.log(api.getContentPane()。 html(a));'顯示所有返回的AJAX調用的html數據,但它不會顯示在頁面上。在AJAX調用之後,jspContainer div不會被放入標記中。 – techouse 2011-12-26 12:23:15
嗯...我發現'的console.log(api.getContentPane()HTML(一));'顯示,該AJAX返回的內容缺少'