Created
November 9, 2014 09:08
-
-
Save nanto/695cfa663c066077e2ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>host of cloned 'a' element</title> | |
</head> | |
<body> | |
<script> | |
var a = document.createElement('a'); | |
a.href = ''; | |
a = a.cloneNode(false); | |
document.write('<p>a.host: ' + a.host + '<\/p>'); | |
document.write('<p>location.host: ' + location.host + '<\/p>'); | |
</script> | |
</body> | |
</html> |
This behavior of IE was referred to in http://d.hatena.ne.jp/monjudoh/20110207/1297071182 (written in Japanese).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Open console and run the following code in any page.
We expect
a.host
to be'bl.ocks.org'
but in IE it becomes a host of parent document.