add jquery tab from outside page
I have an application that uses jquery tabs to open up different asp.net applications from its "menu" tab. The content of the tabs is an iframe with the application. What I need is for one of the application tabs that is inside an iframe to open a page in a new tab. I am running the apps in iis 7 with asp.n开发者_Python百科et. how can I send a signal to the "tabs" application to open a new tab?
window.parent
will allow you to access the outer app.
as @Anthony suggested you can use window.parent
and window.parent.document
to access objects on the parent window containing iframe
, but better way will be to write a function on parent window to open new window and then call that from iframe
code because it is more foolproof.
//in parent window
window.openNewWindow = function(/*ANY PARAMS*/){
//open window here
};
//in iframe
parent.window.openNewWindow(/*PARAMAS (IF ANY)*/);
精彩评论