DEV Community

Tomohiko Himura
Tomohiko Himura

Posted on

2 2

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay