JavaScript extended functionality for jQuery printThis plugin#21
JavaScript extended functionality for jQuery printThis plugin#21iliaross wants to merge 1 commit intojasonday:masterfrom iliaross:patch-1
Conversation
…d JavaScript to child (print) iframe This modification is an example of how to extend plugin's functionality, by adding 'importJS' and 'loadJS' options.
|
Can you set up a jsfiddle with a potential use case? |
|
Jason, I have checked and it worked in IE11 and most likely will work in version 9 and 10. I can't setup jsFiddle for you with the particuar example as it takes to much time but can tell you when I needed it. We use printThis to print certain part of pages. When you use dynamic libraries to arrange content (like Masonry or Isotope), for example to force all tables with different height, to be positioned right below each other, you need to reload those for print version, because you change the font's size, and other formatting for print version almost everytime. When you do it, the content's height is also changing and you need to reload js to make it look correct on the print verstion. Simplest way to check it is just to add alert to the code and run accros all browsers: $("#mySelector").printThis({ Try it it should work everywhere, if not, tell me where it's not working and I will try to debug to make it work! |
|
Hi rostovstev, I'd like to merge this pull request, however I am requiring that the author/reporter provide a demo of any changes (or bugs) in jsfiddle.net or jsbin.com for review & browser testing. |
|
Jason, as the code uses document.write, it's disallowed on jsFiddle.net and returns an error: |
|
Can you try jsbin.com? On 1/28/2014 5:43 AM, Ilia wrote:
|
|
No sure what you want, Jason! It will not work: http://jsbin.com/IkaYOFA/1 |
This modification is an example of how to extend plugin's functionality, by adding 'importJS' and 'loadJS' options. This will let the user to chose whether to load parent page's .js files and whether to execute custom JavaScript code.