【发布时间】:2013-01-22 01:30:42
【问题描述】:
以下代码在 FF、opera 和 chrome 中运行良好,但在 IE 中失败
function get_modelo(modelo) {
var selState = modelo;
alert (selState);
console.log(selState);
$.ajax({
url: "site/ajax_call", //The url where the server req would we made.
async: false,
type: "POST", //The type which you want to use: GET/POST
data: "state="+selState, //The variables which are going.
dataType: "HTML", //Return data type (what we expect).
//This is the function which will be called if ajax call is successful.
success: function(data) {
//data is the html of the page where the request is made.
$('#city').html(data);
}
})
}
无法理解问题。
【问题讨论】:
-
每当我遇到 IE 从 AJAX 调用返回 HTML 的问题时,我都会首先检查 HTML 是否有效。如果您忘记关闭标签或其他东西,IE 就不会那么宽容了。
-
从你的代码中删除console.log行....此行停止执行ie中的其他行
标签: ajax internet-explorer codeigniter