举例:某新闻链接地址如下:
http://www.aaa***.com/news/123101.html
http://www.bbb***.com/news/123102.html当点击该新闻链接时地址栏正常情况下显示:
http://www.aaa***.com/news/123101.html
http://www.bbb***.com/news/123102.html现在想点击上述新闻链接时让浏览器地址栏只显示:
http://www.aaa***.com/   后面的自行省略。
http://www.bbb***.com/   后面的自行省略。顺祝各位元旦快乐!

解决方案 »

  1.   


    <a href="http://www.aaa***.com">http://www.aaa***.com/news/123101.html</a>
      

  2.   

    <a href="http://www.aaa***.com/news/123101.html" onclick="location=href.substring(0,href.indexOf('/',10));return false">http://www.aaa***.com/news/123101.html</a>
      

  3.   

    刚才理解错误,看下面:<a href="http://www.aaa***.com" onclick="location=innerText;return false">http://www.aaa***.com/news/123101.html</a>
      

  4.   

    <a href="http://www.aaa***.com">http://www.aaa***.com/news/123101.html</a>