我页面的超链接设置了<a target="_blank" href="baidu.com">百度</a>,可是我打开这个链接的时候地址栏却是localhost:8080/hello/www.baidu.com,这个是什么情况啊,导致不能访问百度,这是什么情况啊,有没有大神解释下啊,下面是源码
<a class="buyit" title="前往地址<?php the_title(); ?>" target="_blank" href=" <?php echo get_post_meta($post->ID, "百度地址",true);?>"></a>htmlphp

解决方案 »

  1.   

    你要想办法在前面加上: http://www.
      

  2.   

    你没加 www 吧,在就是指访问 网址,为什么不直接写,还要这样绕一圈,不理解。。
      

  3.   

    <a target="_blank" href="baidu.com">百度</a>
    <a target="_blank" href="http://www.baidu.com">百度</a>
    这两种是两回事,第一种是相对路径,第二种是绝对路径,所以第一种是访问本地