hostプロパティ Javaスクリプトのプロパティ hrefプロパティ

hostnameプロパティ

hostnameプロパティはサーバのホスト名またはIPアドレスです。

シンタックス

	
	
	objectName.hostname
	
	

オブジェクト

	
	
	<script>
	
	document.write("例1: " + location.hash + "<p>");
	document.write("例2: " + location.host + "<p>");
	document.write("例3: " + location.hostname + "<p>");
	document.write("例4: " + location.href + "<p>");
	document.write("例5: " + location.pathname + "<p>");
	document.write("例6: " + location.port + "<p>");
	document.write("例7: " + location.protocol + "<p>");
	document.write("例8: " + location.search + "<p>");
	document.write("例9: " + location.target);
	
	</script>
	
	

例1:

例2: yokochin.com

例3: yokochin.com

例4: http://yokochin.com/manual/java/property/hostname.html

例5: /manual/java/property/hostname.html

例6:

例7: http:

例8:

例9: undefined

関連したプロパティ



Copyright (C) 1996-2003 by Yasukazu Yokoi. All Rights Reserved.