0

Is it possible.. to have my javascript, example as in below; to simply continue to execute with my click function but the changes are only reflective in a new window - while current page (non-new window does not change via the JS) is this possible?

   $('.download-pdf').click(function() {

   $(this).attr('target', '_blank');

    notChecked = $("input[type=checkbox]:not(:checked)").parent();
    notChecked.hide();
    yesChecked = $("input[type=checkbox]:checked").parent();

    $.each(yesChecked, function( index, el ) {
      $(el).show().html(texts[$(el).attr('id')]);
    });
Dr Upvote
  • 8,023
  • 24
  • 91
  • 204
  • You want the click to make changes in a page that isn't loaded yet? – Jaromanda X Dec 10 '15 at 22:55
  • Yes, exactly that. Well, I really want the click to only resolve changes in dynamically generated pdf it is generated ie. http://stackoverflow.com/questions/34211409/dynamic-pdf-from-user-input-not-reflective-on-current-page-only-in-the-pdf but as I cannot find a solution for this, this is the hack I'm coming up with. – Dr Upvote Dec 10 '15 at 22:58

1 Answers1

0

You can use the postMessage API which is perfectly described in this SO Answer. You can do this only, if the new window has the same origin.

Probably you'd need to wait some time for the new frame to be fully loaded.

Community
  • 1
  • 1
Julian F. Weinert
  • 7,474
  • 7
  • 59
  • 107