Jhonatan Sandoval
Jhonatan Sandoval

Reputation: 1293

How to open a dialog outside the iframe

I'm calling a jQueryUI Dialog inside the iframe which looks like this:

enter image description here

But i need the dialog outside the iframe (like window.parent ----> open dialog or something like that).

Upvotes: 5

Views: 5386

Answers (1)

G.Mendes
G.Mendes

Reputation: 1201

First, you need to initialize the dialog in the parent with autoOpen set to false if thats the case.

$("#dialog").dialog({ autoOpen: false });

After you can open it from the iframe by adding parent. before the expression:

parent.$("#dialog").dialog("open");

Upvotes: 6

Related Questions