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')]);
    });
2
  • You want the click to make changes in a page that isn't loaded yet? Commented Dec 10, 2015 at 22:55
  • Yes, exactly that. Well, I really want the click to only resolve changes in dynamically generated pdf it is generated ie. stackoverflow.com/questions/34211409/… but as I cannot find a solution for this, this is the hack I'm coming up with. Commented Dec 10, 2015 at 22:58

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.