DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป is a community of 970,177 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Tomohiko Himura
Tomohiko Himura

Posted on

hostname of anchor element throws undefined exception when href attribute has non break space in IE11

IE11 ใงไปฅไธ‹ใฎใ‚ณใƒผใƒ‰ใงๆœชๅฎš็พฉใฎใ‚จใƒฉใƒผใŒ็™บ็”Ÿใ™ใ‚‹

var dom = document.createElement('a'); dom.href="http://example.com ใ‚ใ‚ใ‚"
dom.hostname

ย ใจใƒžใƒซใƒใƒใ‚คใƒˆใ‚’ใ‚‚ใคURLใ‚’hrefใซใ„ใ‚ŒใŸ็Šถๆ…‹ใงhostnameใ‚’ๅ‘ผใณๅ‡บใ™ใจๆœชๅฎš็พฉใฎใ‚จใƒฉใƒผใŒ็™บ็”Ÿใ—ใŸใ€‚

Top comments (0)

๐ŸŒš Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.