views:

99

answers:

1

Hi ,

I wanted to change the JavaScript Execution context from parent window to child window. The different library's inline script, loaded in parent window should be made available to child window execution context. I am able to load my script objects, functions to the child window context but the third party library's is not possible .

This is what i am doing to load my script's

// In parent window
function JJ(){};
JJ.prototype.param = {"k":"v"};

function CNF(){
    return new JJ(); 
};


// In child Window

var opener = window.opener;
var CHILD_CNF = opener.CNF();
alert(CHILD_CNF.param.k);

Thanks

A: 

You might as well make the third party library be publicly available on the CHILD's context:

On the Child context do this:

<script>
   window.somePublicName = thirdParyName;
</script>

On the Parent context do this:

child.somePublicName
jerjer