Javascript examples for jQuery:iframe
Set jQuery data() on an iFrame body tag and retrieve it from inside the iFrame
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> </head> // w w w . j a v a 2 s.c o m <body> <iframe src="http://jsbin.com/"></iframe> <script> $(function() { var scope = $('iframe')[0].contentWindow.document; $('body', scope).data('id', 'some id'); console.log($('body', scope).data('id')); }); </script> </body> </html>