【旧版2016.4.17前】东北大学校园网一键登陆ajax版
2016-04-18 19:15
323 查看
这个版本是写的比较简单的,可以通过一键登陆校园网,免去多次页面跳转的操作和密码的输入方式。实质是模拟断开网络和重新连接两次操作,可能存在http错误(这个暂时没有考虑)。
优点:
帐密直接嵌入到html中即可;
通过ajax免去页面的跳转,最终实现一个页面直接完成所有操作;
ps:虽然不是什么很牛的方法,室友不愿意尝试新东西好可惜。
优点:
帐密直接嵌入到html中即可;
通过ajax免去页面的跳转,最终实现一个页面直接完成所有操作;
ps:虽然不是什么很牛的方法,室友不愿意尝试新东西好可惜。
<head> <meta charset="utf-8"> </head> <body> <script> var XMLHttpReq; function createXMLHttpRequest() { try { XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP"); } catch(E) { try { XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { XMLHttpReq = new XMLHttpRequest(); } } } function sendAjaxRequest(url) { createXMLHttpRequest(); XMLHttpReq.open("post", url, true); XMLHttpReq.send(null); } window.onload = function(){ url = "http://ipgw.neu.edu.cn/ipgw/ipgw.ipgw?uid=stu_xxxxxxxx&password=xxxxx&operation=disconnectall&range=2&timeout=1"; sendAjaxRequest(url); url = "http://ipgw.neu.edu.cn/ipgw/ipgw.ipgw?uid=stu_xxxxxxxx&password=xxxxx&operation=connect&range=2&timeout=1"; sendAjaxRequest(url); window.close(); } </script> </body>
相关文章推荐
- 用异或来交换两个变量更耗时
- Linux C++编译运行过程
- C++ WINDOWS API 第1章 Windows 应用程序开发入门
- spring aop 拦截业务方法,实现权限控制
- javascript中的prototype
- 更简单地进行Auto Layout--SnapKit 支持swift
- Android资源文件-Shape
- Python练习题
- 关于andriod SDK无法下载更新
- windows下利用线程池完成多任务的分配和运行
- okhttp教程——起步篇
- 【JUC】JDK1.8源码分析之CyclicBarrier(四)
- shell脚本之sed使用详解
- 十大滤波算法程序大全(Arduino精编无错版)
- java中的List
- Numpy教程
- Collection/List/ArrayList
- 向正在运行的Linux应用程序注入代码
- Nginx重新编译添加模块
- 存储卡路径(接口路径)