快轉到主要內容

Javascript Location Properties

·272 字· loading · loading ·
目錄
How to get infomations of URL on javascript?

Table
#

For example url https://example.org:8080/path/?arg=a&arg2=b#toc:

PropertyValueBlankable
hrefhttps://example.org:8080/path/?arg=a&arg2=b#toc
originhttps://example.org
protocolhttps:
hostnameexample.org
hostexample.org:8080only "example.org" when using default port
port8080empty "" when using default port
pathname/path/at least the root path "/"
search?arg=a&arg2=bempty "" when no arguments (event write the question sign "?")
hash#tocempty "" when no toc (even write the hash sign "#")

References
#

Alpaca
作者
Alpaca
No one can stop my feet.

相關文章

git diff 顯示一堆「^M」?

·1403 字· loading · loading
在不同 OS 底下共同編輯一個 git repository 時,可能就會出現這個問題,要解決該問題其實也很簡單,其原理及解決方法敬請聽我娓娓道來。