【发布时间】:2012-02-16 06:44:22
【问题描述】:
我正在尝试制作一个非常简单的 CMS 系统,到目前为止一切都很好。
但是现在当我尝试将编辑页面加载到 div (.load - jQuery) 时,IE 不会显示它,而 Firefox 会。
这是我的加载代码
function edit_item(id){
$('#row_'+id).load("actions/edit.php?id="+id, function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$('#row_'+id).html(msg + xhr.status + " " + xhr.statusText);
}
});
}
这是我要加载的页面
<?php
include('connect.php');
$item = resultset;
?>
<script>
$(function() {
$("#datepicker").datepicker();
$("#datepicker").datepicker("option", "dateFormat", "yy-mm-dd");
var currentdate = $("#currentdate").val()
$("#datepicker").datepicker('setDate', currentdate);
});
</script>
<form method="POST" action="actions/update.php">
<input type="hidden" id="currentdate" value="<?=$item['datum']?>">
<table style="border: 1px solid black; margin-left: 10px; width: 620px;">
<tbody>
<tr>
<td>Titel</td>
<td><input type="text" name="titel" class="input" style="width: 560px;" value="<?=$item['titel']?>"></td>
</tr>
<tr>
<td>Datum</td>
<td><input type="text" name="datum" class="input" id="datepicker" style="width: 560px;"></td>
</tr>
<tr>
<td>Bericht</td>
<td><textarea name="inhoud" class="input" style="width: 560px; height: 300px;"><?=$item['inhoud']?></textarea></td>
</tr>
<tr>
<td>Foto's</td>
<td>
<input type="file" name="foto[]">
<input type="file" name="foto[]">
<input type="file" name="foto[]">
<input type="file" name="foto[]">
<input type="file" name="foto[]">
<input type="file" name="foto[]">
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" id="toevoegen" value="Updaten" class="input" style="float:right; margin-right: 5px; margin-top: 5px;"></td>
</tr>
</tbody>
</table>
<input type="hidden" name="id" value="<?=$_GET['id']?>">
<input type="hidden" name="aktie" value="item">
</form>
Internet Explorer 给我这个错误:
抱歉,出现错误:0 错误:无法完成 由于错误 c00ce56e 导致的操作。
解决方案: header('Content-Type: text/html; charset=UTF-8'); 可以解决问题,但 IE 已将其缓存。当我清除它时 - 它又开始工作了,所以谢谢!
【问题讨论】:
-
我喜欢 Dear StackOver(flowers)
-
请在下方发布您的解决方案,然后接受您自己的答案。在回答您自己的问题时,这是使用本网站的最恰当方式。
-
另外,我看到@BenP 的帖子导致了答案。您应该支持他并接受这一点(他也需要改进他的答案)。
标签: jquery internet-explorer xmlhttprequest