WMLScript getHost() 関数

getHost() 関数は、url パラメータで指定されたホストを返します。

構文

n = URL.getHost(url)
要素 説明
n 関数から返される文字列。
url 一つの文字列。

var a = URL.getHost("http://www.codew3c.com/wml");
var b = URL.getHost("/wml/functions");

結果

a = "www.codew3c.com"
b = ""