請仔細閱讀本jsFiddle ...Ajax請求沒有拉起jQuery的對話窗口
這是利用一個Ajax請求拉起內容的jQuery UI的對話框。我似乎無法弄清楚什麼是錯誤的,但除了空白的對話框之外什麼都沒有彈出。
HTML ...
<div id="#griffin"></div>
<ul>
<li>
<a href="ajax/ajax-bj.html" class="griffin-style all-about-bj" id="all-about-bj"></a>
</li>
</ul>
的JavaScript ...
$(function() {
$("#griffin").dialog({
autoOpen: true,
modal: true,
width: 950,
height: 'auto',
show: 'fade',
hide: 'fade',
position: {my: "center top", at:"center top", of: window },
buttons: {
"I have Read and Understand": function() {
$(this).dialog("close");
}
}
});
$(".griffin-style").on("click", function(e) {
e.preventDefault();
$("#griffin").html("");
$("#griffin").dialog("option", "title", "Loading...").dialog("open");
$("#griffin").load(this.href, function() {
$(this).dialog("option", "title", $(this).find("h1").text());
$(this).find("h1").remove();
});
});
});
的思考?
但是,我會在何處放置href?我試圖在根上調用另一頁。 – webfrogs
我需要它與我原來的樣式相同。這是它所在的實際頁面。我把ajax請求放在了你所說的地方,但它仍然沒有出現。該網頁是[** here **](http://webfro.gs/south/bj/Template2.html)。思考? – webfrogs