vistaprint / SkinnyJS

Slim little jQuery plugins
http://vistaprint.github.io/SkinnyJS
Other
41 stars 27 forks source link

Passing Message from Parent Window to Child Window #99

Open dynamasoft opened 9 years ago

dynamasoft commented 9 years ago

Hello There - First of all great work on creating this library.

Since I am fairly new in using this library, I am having an issue with passing message from parent window to child window in ie8 using postmessage.htm.

The issues are below:

  1. In the Jquery.PostMessage.js, the serializewnidowreference function is somehow throws an exception because it can't build a relationship between parent (opener) to the child window. On the other hand child to parent works okay since it check on window.parent.
  2. I saw an optional parameter to pass the targetWindowName by the name. I did this, but then I encountered another error in the postmessage.htm

ript type="text/javascript"> (function () {

    var win, data = document.location.hash.split("&");
    if (data.length < 4) throw new Error("Invalid hash for postmessage");
    // Refernece is a name (string)
    if (data[1].substr(0, 1) === ':') {
        win = window.open("", winRef[1].substr(1));
    }

This condition yields true if (data[1].substr(0, 1) === ':') { however winRef was not defined.

I appreciate your help in advance!

Smitty