postMessage into object tag

2019-06-13 18:28发布

I am trying to get the html inside an object respond to my postMessage, but I am unable to get the referencing correct.

I've tried

var object = $("#test_object").get(0).contentWindow;
object.postMessage("run","*");

which works for iframe.

But as i am determined to use the object tag. Is there a way to pass the postMessage through?

1条回答
不美不萌又怎样
2楼-- · 2019-06-13 19:02

No, postMessage works only for iframes and windows/tabs.

查看更多
登录 后发表回答