码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2017-08-31 19:08:25      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:datagrid   over   rip   back   asc   ram   pre   tac   blank   

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

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

标签:datagrid   over   rip   back   asc   ram   pre   tac   blank   

原文地址:http://www.cnblogs.com/yeminglong/p/7459521.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!