Ihm: can i show you my.

 
Lander: What do I put in its place?

Ihm: Whatever selector will get the iframe

Dante: The iframe doesn’t seem to have a name ***ociated to it?

Fittje: Http://i.imgur.com/d9SXVtr.png

Ihm: Do you have more than one iframe on the page?

Hoeser: Ihm: it is called from a contextmenu: https://gist.github.com/maasha/3730979cb6e5cbf2b86f7bb72b859ca1

Ihm: Maasha: well your appending to the body every time that method is called

Hnot: A bit hard to wade through all the wordpress code but there seems to be some

Ihm: Slereah: console.log$’form’.length;

Talleut: Ihm: yes, that is not really what I wanted

Ihm: Slereah: console.log$’iframe’.length;

Ihm: Slereah: console.log$’.media-iframe iframe’.length;

Merriott: So what do I use to get the content?

Ihm: Maasha: so either you’ll need to change it to do it only once, or potentially check to see if what you appended already exists, and if so either don’t append, or replace with the new version

Weikert: I finished my work but there is one tiny problem xD

Ihm: Slereah: stick $’.media-iframe iframe’.content in your console

Mcinturf: I tried but I just get TypeError: $..content is not a function

Ihm: Replace $ with jQuery

Ihm: And it’s plural, contents

Perolta: ReferenceError: JQuery is not defined

Rebeiro: Maybe I should ask the wordpress stackexchange

Gorey: They might have a specific solution

Weikert: I am sure there is a channel

Gaznes: It’s a bit moribund, though

Knoerzer: ObjectDo***ent media-upload.php?chromeless=1&post_id=112&tab=tab_slug

Legrant: Anything in particular in that object?

Ihm: I think we maybe good

Ihm: So you have access to that other dom

Ihm: So you can do bindings and stuff

Ihm: Do***ent Object Model

Ihm: It’s what HTML is p****d into and the browser uses to actually draw your page

Weikert: Slereah: it is tree structure for representing HTML

Herwehe: Ihm: not draw, but p****

Merling: So what can I do to run that script then?

Crofford: They use a separate data structure for what they actually draw

Weikert: Seperate data structure you mean “tree” Cork ?

Ihm: Slereah: so you’ll want to do something with that after the iframe shows

Shadley: Weikert: don’t remember the name, and it differs from engine to engine

Ihm: In which case with access to that iframe dom, your free to do whatever bindings/modifications you want, as if you were on that page

Bridgford: Ihm, Weikert: the dom is there to let javascript navigate the elements

Merry: I tried to bind the script when the iframe loads but doesn’t seem to?

Skagen: If I do that instead of at the beginning, the script doesn’t appear in the list of scripts

Zigomalas: Slereah: what is the problem wasn’t here at the start of the question

Simoens: Ihm: ok, so now only adding the dialog once, and set it to .hide – that works

Ihm: He’s trying to bind one a button inside an iframe loaded by wp

Hogge: And the iframe is loaded from the same domain?

Ihm: Slereah: you’d have to do it after the iframe loads, not at the load of the original page

Tankxley: Well, here’s the function that is executed during the loading

Mender: Http://pastebin.com/MXYYqdTi

Kissner: Ya, you have to bind an onload event on the iframe and from there navigate into the iframe and bind the event handler

Ihm: No clue about wp stuff, :

Weikert: Ihm: can i show you my last effort?