JSFiddle - React, Tailwind, and code Playground
by Nick Craver
HTML
<iframe id="frame" src="http://fiddle.jshell.net/Mottie/c5JeU/show/light/" height="200" width="400"></iframe>
<br><br>
<button>Get Frame Data</button>
JavaScript
/* Frame data set up as follows (http://jsfiddle.net/Mottie/c5JeU/):
$('#data')
.data('test1', 'this is test data 1')
.data('test2', ['John', 'Smith'])
.data('test3', {
alert1: function() {
$('#data').append('test3: successful<br>');
}
})
*/
$('button').click(function(){
var fjq = $('#frame')[0].contentWindow.$;
var f = $('#frame').contents().find('#data');
f.append( '----------<br>');
f.append( 'test1: ' + fjq.data(f[0], 'test1') + '<br>test2: ' + fjq.data(f[0], 'test2') + '<br>' );
f.append( 'test3: ' + typeof (fjq.data(f[0], 'test3')) + '<br>' );
})