URLの諸々把握
例えばこんなURLがあったとして、、
http://www.foo.com:8000/mac/macbook.php?color=grey#custom
よく使うのはこのあたり
location.href => http://www.foo.com:8000/mac/macbook.php?color=grey#custom location.hostname => www.foo.com location.search => ?color=grey location.hash => #custom
こういうのも取れる
location.protocol => http: location.host => www.foo.com:8000 location.port => 8000 location.pathname => /mac/macbook.php