在将iframe加载到动态创建的弹出窗口中后,如何在iframe中调用带有参数的函数? [英] How to call a function with params in Iframe after loading the iframe in the pop-up dynamically created?

查看:206
本文介绍了在将iframe加载到动态创建的弹出窗口中后,如何在iframe中调用带有参数的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我正在加载搜索结果.当用户单击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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆