oyvindkinsey/easyXDM — Issue #161: check 'callerWindow.contentWindow.sendMessage' in NameTransport
Author: j1anb1n
Created: 2012-03-05 09:03:21+00:00
State: open

In my project, I need to move the script in name.html to another javascript file like name.js.

so, sometime it will fail while call callerWindow.contentWindow.sendMessage.

my resolution is:

```javascript
easyXDM.stack.NameTransport = function(config){
...
function _onMessage(message){
(function test(){
if (typeof callerWindow.contentWindow.sendMessage == "function") {
pub.up.incoming(message, remoteOrigin);
}
else {
setTimeout(test, 50);
}
}());
}
...
```