Title: iframe problem with upload.js
Last modified: August 18, 2016

---

# iframe problem with upload.js

 *  [mhammout](https://wordpress.org/support/users/mhammout/)
 * (@mhammout)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/iframe-problem-with-uploadjs/)
 * **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

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [davidryman](https://wordpress.org/support/users/davidryman/)
 * (@davidryman)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/iframe-problem-with-uploadjs/#post-613823)
 * 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!!!
 *  [byknight](https://wordpress.org/support/users/byknight/)
 * (@byknight)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/iframe-problem-with-uploadjs/#post-613841)
 * 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.
 *  [byknight](https://wordpress.org/support/users/byknight/)
 * (@byknight)
 * [18 years ago](https://wordpress.org/support/topic/iframe-problem-with-uploadjs/#post-613844)
 * 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.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘iframe problem with upload.js’ is closed to new replies.

## Tags

 * [iframe](https://wordpress.org/support/topic-tag/iframe/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [uncaught exception](https://wordpress.org/support/topic-tag/uncaught-exception/)
 * [upload](https://wordpress.org/support/topic-tag/upload/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [byknight](https://wordpress.org/support/users/byknight/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/iframe-problem-with-uploadjs/#post-613844)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
