Skip to content

Instantly share code, notes, and snippets.

@zhiyelee
Created February 11, 2014 04:30
Show Gist options
  • Save zhiyelee/8929280 to your computer and use it in GitHub Desktop.
Save zhiyelee/8929280 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="instanceof cross iframe" />
<meta charset="utf-8">
<title>instanceof cross iframe</title>
</head>
<body>
<iframe id="fr" ></iframe>
</body>
</html>
var fr = document.getElementById('fr');
var arr = [];
var ArrayFr = fr.contentWindow.Array;
var arr2 = new ArrayFr();
console.log(Object.prototype.toString.call(arr));
console.log(Object.prototype.toString.call(arr2));
console.log(arr instanceof Array);
console.log(arr instanceof ArrayFr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment