【问题标题】:Ext.get and update not working in IEExt.get 和更新在 IE 中不起作用
【发布时间】:2012-04-12 17:33:09
【问题描述】:

我无法让 Ext.get 在 IE 中工作。在 FF、Chrome 甚至 Safari 中运行良好。

我的 HTML 如下所示:

<select id="products" onchange="getReleases()">
    <option value="select">Select</option>
</select>

Ext 调用是这样的:

...
success: function(response) {

    alert("response.responseText: " + response.responseText);
    Ext.get("products").update(response.responseText);          
}

我在警报功能中看到了结果。我错过了什么?

【问题讨论】:

  • 您的response.responseText 包含什么内容?

标签: extjs


【解决方案1】:

这似乎不是 Ext 的实际问题,而是 IE 的问题。您可以通过查看Ext.get("products") 对变量的结果来了解这一点。

var result = Ext.get("products");
console.log(typeof result !== "undefined");

我们可以从日志语句中看到它的结果不是未定义的(另外,如果它是未定义的,它将无法执行update())。

这一切都假设 response.responseText 的形式为'&lt;option value="select"&gt;Select1&lt;/option&gt;',我认为这是因为您让它在除 IE 之外的所有浏览器中都能正常工作。

看起来这是 IE 的 select 元素的 innerHTML 属性的一个已知问题。以下提供了解决方法的解释和链接:

Javascript - innerHTML not working with HTML select menus

这里是 MS 错误的链接:http://support.microsoft.com/kb/276228

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-28
    • 2014-04-26
    • 2011-11-30
    • 1970-01-01
    相关资源
    最近更新 更多