我試圖更新一個div與$.get
通話內容,但它是在ie(9).
即不工作
的js
失敗的jQuery $不用彷徨是這個
function UpdateElementOfParent(box_id, page_ref, template_ref)
{
$.get("get_content.php", { box_id: box_id, page_ref: page_ref, template_ref:template_ref })
.done(function(data) {
$('#'+box_id).html(data);
});
}
和get_content.php
是這
<?php
include("connect.php");
$page_ref = $_GET['page_ref'];
$template_ref = $_GET['template_ref'];
$box_id = $_GET['box_id'];
$sql = mysql_query("SELECT * FROM site_content WHERE page_ref='$page_ref' AND template_ref='$template_ref' AND box_id='$box_id' AND box_type='text'");
while($row=mysql_fetch_array($sql))
{
echo stripslashes($row['content']);
}
?>
它firefox/chrome/safari and opera.
php的更新數據庫,但在ie
的div ("#"+box_id)
犯規更新(只有ie9
手頭所以不知道它只是9個或其它版本也)
任何線索?
快速更新
似乎即是從緩存中先前的$不用彷徨呼叫保持一些數據。基本上我在屏幕上有一個div,當用戶點擊一個按鈕時,一個圖層打開,並帶有可用nicedit編輯的textarea。 textarea填充了一個$ .get,然後用戶單擊保存,圖層被隱藏,並且父頁面上的原始div使用相同的$ .get調用進行更新。
在即,如果我更改內容,數據庫更新但div不是,當我打開圖層時,它仍顯示舊數據。
第一$不用彷徨調用這個
$.get("get_content.php", { box_id: box_id, page_ref: page_ref, template_ref:template_ref })
.done(function(data) {
document.getElementById("edit_content").value=data;
area1 = new nicEditor({fullPanel : true}).panelInstance("edit_content",{hasPanel : true});
});
的警報數據犯規顯示在IE更新的文本,它肯定的東西與$不用彷徨呼叫
嘗試'去除;從行' 5和6 – silentw
@silentw,這不應該有任何問題 –
@SamuelLiew你沒有讀過,有時IE是越野車,因爲不必要的';'? [REF](http://mislav.uniqpath.com/2010/05/semicolons/) – silentw