我想做一个非常简单的CMS系统,迄今为止很好。 但是现在,当我试图将编辑页面加载到div
(.load
- jQuery)时,IE浏览器不显示它,Firefox会。Internet Explorer不执行jQuery.load(火狐浏览器)
这里是我的代码加载
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的给我这个错误的页面:
Sorry but there was an error: 0 Error: Could not complete the operation due to error c00ce56e.
解决方案:header('Content-Type: text/html; charset=UTF-8');
正在做的伎俩,howeve IE已经缓存了。当我清除它 - 它再次开始工作,所以谢谢!
我喜欢亲爱的StackOver(鲜花) – defau1t
请在下面发布您的解决方案,然后接受您自己的答案。这是在回答自己的问题时使用本网站的最合适的方式。 – Sparky
另外,我看到@ BenP的帖子导致回答。你应该加强他并接受他(他还需要改进他的答案)。 – Mrchief