简体   繁体   中英

Object doesn't support property or method 'createContextualFragment'

A coworker is using Ipipeline to display some data in a frame. I need the same functionality and cloned much of that code. The original pgm uses master pages in a CS.net environment while I am coding in a VB.net environment which uses user controls, not master pages.

If I View the HTM in the Browser in isolation, the page displays and the dropdown lists work perfectly. But when I embed it in an iframe tag in a very simple page and run, the page displays but then I get:

Microsoft JScript runtime error: Object doesn't support property or method 'createContextualFragment' when clicking on the first drop-down list on the page.

This test page looks like:

<body>
    <form id="form1" runat="server">
    <div>
     <iframe id="frame1" src="../Ipipeline/xxxxx.htm"></iframe>
    </div>
    </form>
</body>

I did see the StackOverflow article at StackOverflow article but I don't think it pertains as this does work on my IE9 machine without the iframe.

Steps I have taken:

  • I saw that the default DOCTYPE didn't allow for framesets so I exchanged it for one that does, but that didn't help: same behavior.

Any suggestions?

I had a similar issue and adding this javascript to my page fixed the problem. In my case it was related to an activewidget component calling createContextualFragment. I declared this javascript after all other javascript links and it solve the issue for me.

<script type="text/javascript">
if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment)
{
    Range.prototype.createContextualFragment = function(html)
    {
        var frag = document.createDocumentFragment(), 
        div = document.createElement("div");
        frag.appendChild(div);
        div.outerHTML = html;
        return frag;
    };  
}
</script>

Hope it helps.

Fede

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM