How to call a function with params in Iframe after

2019-08-24 06:40发布

问题:

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.

simply : html page to popup + load iframe + call iframe function with html page params + create html and append in Iframe + print... - please help me in this..

Thanks In advance!

回答1:

You can change the css rules depending on the media used with CSS media types.

For example:

@media print {
  body { font-size: 10pt }
}
@media screen {
  body { font-size: 13px }
}
@media screen, print {
  body { line-height: 1.2 }
}