用location的href和hostname属性,示例如下:
<a href="#" onclick="javascript:window.location.href='http://'+window.location.hostname+':8080/em'">jiwo.org</a>
location的属性如下: