需要合作伙伴联系我,VX(绿泡泡): w6668263      email:ye583025823@126.com

如何通过 iframe 共享 jQuery $.data?

index.html

<div id="div1">

</div>
<iframe src="ajax2.html" name="frame2" frameborder="0"></iframe>

<script type="text/javascript">


    $("#div1").data("datagrid", {name: "叶龙龙"});

</script>

ajax2.html

 console.log($("#div1",parent["frame2"].document).data());

https://stackoverflow.com/questions/4101457/access-jquery-data-from-iframe-element

https://stackoverflow.com/questions/4941435/how-to-share-jquery-data-data-through-iframes

posted on 2017-08-31 17:46  龙行龘龘9527  阅读(806)  评论(0编辑  收藏  举报

导航