事件背景如下:
我拉了一个小区宽带的网线上网,每次开机打开网页的时候,
第一次打开网页(无论是什么网页 http请求)肯定会自动跳转到该提供商的主页上面,好烦人 - -!我现在就想了个办法,就是开机的时候我打算指定开一个我本地写的网页,上面用ajax的方式 请求http理解一个网页 等他在这个链接上面 跳转 而不用给我看到然后再打开www.hao123.com 这类型的网址导航上请各位大侠帮忙一下, 本人对ajax 不太会 谢谢

解决方案 »

  1.   

    使用ajax不如写个js 把下面代码写在一个页面中
    <script>
      window.location.href="要跳的页面";
    </script>
      

  2.   

    不是, 他是在你发出外网http响应回来之后 ,提供商在 协议上面转发
      

  3.   

    Ajax 我都不熟悉 但我用 java 写个给你吧估计能实现楼主的意思 public static void main(String[] args) throws MalformedURLException {
    URL url=null;
    URLConnection conn=null;

    try {
    url = new URL("http://www.163.com");
    conn = url.openConnection(); 
    System.out.println("Open "+ conn.getURL()+ " is OKey!");
    } catch (Exception e) {
     
    e.printStackTrace();
    } try {
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+"http://www.hao123.com" );
    } catch (IOException e) {
    e.printStackTrace();
    }

    }
      

  4.   

    谢谢 3楼的同学
    这个好在我电脑上有装 jdk 都可以运行
    但如果我没有jdk 就麻烦点