2011-01-23 78 views
0

嗨有人可以幫助我如何在第一個例子中指定,我只想處理一個certian DIV,就像我可以用「加載」方法insteasd「ajax」長版本一樣? 謝謝jQuery Ajax只加載某個div嗎?

// WITH EXTENDED VERSION, how to specify a div to be processed? 
$.ajax({ 
    url: 'ajax/test.html', 
    success: function(data) { 
    $('#current-div').html(data); 
    alert('Load was performed.'); 
    } 
}); 

// WITH LOAD, it's ok| 
$("a").click(function() { 
    var myUrl = $(this).attr("href") + " #external-div"; 
    $("#current-div").load(myUrl); 
    return false; 
}); 
+2

最新消息您的問題? – 2011-01-23 12:58:15

回答

0

我認爲這是你追求的?

$('#current-div').load('ajax/test.html'); 
alert('Load was performed.');