postMessage进入对象标签 [英] postMessage into object tag

查看:211
本文介绍了postMessage进入对象标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让对象内部的html响应我的postMessage,但我无法正确引用。

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

我试过

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

适用于iframe。

which works for iframe.

但是我决定使用object标签。有没有办法传递postMessage?

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

推荐答案

不,postMessage仅适用于iframe和windows / tabs。

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

这篇关于postMessage进入对象标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆