我有這個網站:如何強制href指向外部主機頁面?
<a href="http:/myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)">live map</a>
我在瀏覽器中打開它,內容如下:
,當我按下鏈接我的直接到:
http://localhost:63342/myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)
我該如何改變它:(新的http頁面):
"http:/myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)"
更新
怎麼能說是,它的產生的 「http:/」 的不是 「http://」?
這是我的網址構建器:
UriBuilder builder = UriBuilder
.fromPath(Constants.LIVEMAP_BASE_URL_US)
.scheme("http");
return builder.build().toString();
如果你想要一個新的瀏覽器窗口,你需要在你的標籤中添加target =「_ blank」。和該網址應該是http:// ... – Gilko