Internet Explorer 不执行 jQuery.load (Firefox 执行)
我正在尝试制作一个非常简单的 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 已将其缓存。当我清除它时 - 它再次开始工作,所以谢谢!
I am trying to make an really simple CMS system, so far so good.
But now when I'm trying to load an editing page into a div
(.load
- jQuery) IE doesn't display it, Firefox does.
Here is my loading code
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);
}
});
}
And here's the page I am trying to load
<?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 is giving me this error:
Sorry but there was an error: 0 Error: Could not complete the
operation due to error c00ce56e.
Solution: header('Content-Type: text/html; charset=UTF-8');
was doing the trick, however IE had it cached. When I cleared it - it started working again so thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谷歌搜索错误代码似乎表明问题在于 XHR 响应的编码。
请参阅:http://blog.shpare.com/2008/ 03/04/错误-c00ce56e-in-ie/
Googling the error code seems to suggest the problem is the encoding of the XHR response.
See: http://blog.shpare.com/2008/03/04/error-c00ce56e-in-ie/
http://support.microsoft.com/kb/304625
检查内容类型的字符集。
http://support.microsoft.com/kb/304625
Check you content-type's charset.