在将iframe加载到动态创建的弹出窗口中后,如何在iframe中调用带有参数的函数? [英] How to call a function with params in Iframe after loading the iframe in the pop-up dynamically created?
问题描述
在我的应用中,我正在加载搜索结果.当用户单击print
按钮时,我想创建一个pop-up
. (可以)但是创建pop-up
时,我想将Iframe
加载到pop-up
中.同样,我需要使用从父页面接收的参数调用Iframe function
,因为我使用的是underscore
模板.我想用api url-(我从父页面作为参数获取)调用几个ajax
请求,并且需要创建html并将其附加到Iframe
-到print
(一旦模板生成html
)
In my app, I am loading search result. while the user click on the print
button I would like to create a pop-up
. ( this is ok ) But when I create a pop-up
, I would like to load my Iframe
in the pop-up
. Again I need to call a Iframe function
with the parameter which i receiving from parent page, Because I am using underscore
template. I would like to call couple of ajax
request with api url - (which i getting from parent page as parameter ) and need to create and append the html in to the Iframe
- to print
(once the template generated html
)
很抱歉,即使有一个人提供了很好的方法,即使大家对此表示赞赏,还是可以向我展示正确的方法,这是很抱歉的.
I am sorry for big summary, Even if any one gives good approach even apart from this as well appreciated or could any one show me the correct approach.
简单地:弹出html页面+加载iframe +使用html页面参数调用iframe函数+创建html并附加到iframe中+打印...-在此方面请帮帮我.
谢谢!
推荐答案
您可以根据例如:
@media print {
body { font-size: 10pt }
}
@media screen {
body { font-size: 13px }
}
@media screen, print {
body { line-height: 1.2 }
}
这篇关于在将iframe加载到动态创建的弹出窗口中后,如何在iframe中调用带有参数的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!