WordPress.org

Ready to get started?Download WordPress

Forums

iframe problem with upload.js (4 posts)

  1. mhammout
    Member
    Posted 6 years ago #

    Hello everyone,
    I have a problem and I tried tenth of hack, but with no success...

    My WordPress is in a iframe (it must be so in my case) and everything works fine except when I click 'Send to editor' button -> it tells me "win.edInsertContent is not a function".

    If I open it out of the iframe, I don't have the problem... but unfortunately I need to open it in an iframe...

    I tried to hack it by changing win.edInsertContent(win.edCanvas, h);
    by
    parent.edInsertContent(parent.document.getElementById('content'),h);
    but I got another error:
    uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://.../wp-admin/post-new.php :: edInsertContent :: line 242" data: no]

    Does anyone have an idea?

    Thank you in advance,
    Malik.

    PS: I use FireFox 2.0.0.6

  2. davidryman
    Member
    Posted 6 years ago #

    Hello,
    I have had a similar problem embedding WP in an iframe. I tried what you did and got the same result, my solution is:-

    In the sendToEditor function, 6 or 7 lines above the win.edInsertContent(win.edCanvas, h); line, is win = top;, changing this to win = parent. Now it works from both within iframes and on it's own.

    Hope this helps someone, somewhere, sometime!!!

  3. byknight
    Member
    Posted 6 years ago #

    Maybe, I'll have to try it now. I had some success by going to Writing > Settings > formatting then uncheck "WordPress should correct invalidly nested XTML automatically" - it worked for a while but the problem is back again.

    I also use Firefox, but I get the problem with IE as well - and with Firefox on Ububtu/linux as well.

    I hope this problem that comes and goes would go once and for all: it is a big waste of time.

  4. byknight
    Member
    Posted 6 years ago #

    Next: In Firefox, I disabled "Firebug" - Images loaded OK after that. So I=t seems that disabling all the features that "correct bad HTML" makes a difference, but I'm just groping in the dark.

Topic Closed

This topic has been closed to new replies.

About this Topic