我正在開發一個新項目http://www.hotwirerevealed.com,它顯示/標識hotwire.com上的酒店。輸入狀態和目的地後,我有一個使用jquery的.post方法發佈的javascript函數。發佈請求轉到輸出html的php頁面,我使用jquery的html方法將內容放在頁面上。在AJAX調用後刷新DOM和jquery
像這樣
function post(){
$.post("lookup.php", {action: "find", area: area, stars: stars, amenities: amenities, state: $('#state').val()}, function(data){
$("#details").html(data);
});
}
我有超鏈接到酒店,我喜歡在一個燈箱
<a class="hotel" href="http://google.com/search?btnI=1&q=Amerisuites+Northeast+Orlando+(Airport+MCO)">Amerisuites Northeast</a>
IM使用嘗試使用jQuery的花式框,但看中箱
$(document).ready(function(){
$(".hotel").fancybox({
'width' : '75%',
'height' : '75%',
'type' : 'iframe'
});
});
但它似乎不工作,即時通訊猜測,因爲jquery不知道它在那裏的元素?我試圖用jquery live()方法取得一點成功,任何幫助將不勝感激,謝謝提前
$(「#細節「).html(data)輸出一個表,其中包含一個包含標籤的td元素。順便說一句,這工作完美,非常感謝幫助! – Pim 2010-04-18 02:06:17