开发者

How to open a network/file related webpage from a website itself

开发者 https://www.devze.com 2023-01-06 18:54 出处:网络
I have the following markup from my webpage(say test.html): <html> <body> <a id=\"link1\" target = \"_new\" href=\"http://www.yahoo.com\">Go to Yahoo</a>

I have the following markup from my webpage(say test.html):

<html>
<body>
    <a id="link1" target = "_new" href="http://www.yahoo.com">Go to Yahoo</a>
    <a id="link2" target = "_new" href="http://www.google.com">Go to Google</a>
    <a id="link3" target = "_new" href="file://///server01/localWebPage.html">Go to Local webpage</a>
 </body>    
<html>

This will open a tab/window (and reuse hence the _new target) and it works when ope开发者_Python百科ning the webpage via File|Open|locate to test.html location. However when it's run using the web server (eg IIS). Running this via http://localhost/test.html, will not work for the localWebPage.html.

Any suggestion to make this work?

Thanks


Not sure what you want exactly but if you want to open a page in new tab/window, use the target="_blank", if however, you want it to open in the same window, just leave out the target="_blank" part from the links.

0

精彩评论

暂无评论...
验证码 换一张
取 消