ジャバスクリプト URL 情報 表示
hostname = window.location.hostname;
href = window.location.href;
host = window.location.host;
port = window.location.port;
pathname = window.location.pathname;
search = window.location.search;
protocoal = window.location.protocol;
document.write(hostname);
document.write('<br />');
document.write(href);
document.write('<br />');
document.write(host);
document.write('<br />');
document.write(port);
document.write('<br />');
document.write(pathname);
document.write('<br />');
document.write(search);
document.write('<br />');
document.write(protocoal);
/**
結果
localhost
http://localhost:8080/article/pageView.jsp?articleNo=34&pageNo=1
localhost:8080
8080
/article/pageView.jsp
?articleNo=34&pageNo=1
http:
*/
参照 : ジャバスクリプトで url 分かること(http://bluefubu.net/zbxe/220 で 情報を 得たが 今は ページが 消えた.)
- コメント機能はありません。コメントの代わりに[email protected]にメールを送ってください。