日期:2014-05-17  浏览次数:20461 次

IE9下使用coolite或Ext.net的问题,报js错
有个页面使用到了Coolite或Ext.net,在加载的时候报“Microsoft JScript 运行时错误: 对象不支持“createContextualFragment”属性或方法”。

通过网上搜资料,在页面上加了如下js代码

if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment) {
     Range.prototype.createContextualFragment = function(html) {
     var frag = document.createDocumentFragment(),
         div = document.createElement_x("div");
     frag.appendChild(div);
     div.outerHTML = html;
     return frag;
     };
     }


但在加载的时候就会报“Microsoft JScript 运行时错误: 对象不支持“createElement_x”属性或方法”

请教各位使用过的大神,这个问题怎么解决

------解决方案--------------------
需要在web.config里设置
<httpModules>
      <add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net" />
</httpModules>