|
本帖最后由 287514788 于 2014-6-3 21:52 编辑
那能不能像POST:"http://192.168.1.1/router/l7_web_auth.cgi?user=xxx&pass=xxx&ip=192.168.1.154"这种形式提交呢?下面是自带页面的登陆提交函数,但它的提交路径.post("/router/l7_web_auth.cgi"后面没有?user=xxx&pass=xxx&ip=这段了,本人菜鸟不懂js代码,大虾能解释一下下面的每句意思吗?特别是dhcp的内网ip地址传递给了哪个变量函数
<script type='text/javascript'>
function login_click()
{
igd.err = language.err['CN'];
if(!get_msgbox("user","pppoe_text")||!get_msgbox("pass","password"))return;
var obj = new Object;
obj.user = $("#user").val();
obj.pass = $("#pass").val();
var temp=location.toString();
var temp_str=temp.split("|");
var temp_ip=temp_str[2].split("ip=")[1];
var temp_url=temp_str[1].split("url=")[1];
obj.ip = temp_ip;
$.post("/router/l7_web_auth.cgi",obj,function(data){
data=eval("("+data+")");
if(data == "SUCCESS")
{
if(confirm("认证成功!"))
{ if($("#rem_usr_pass").attr("checked")){
$.cookie( "c_name" , obj.user , { path: '/', expires: 365 });
$.cookie( "c_pwd" , obj.pass , { path: '/', expires: 365 });
}
else{
$.cookie('c_name',null,{ path: '/', expires: 1 });
$.cookie('c_pwd',null,{ path: '/', expires: 1 });
}
window.setTimeout("jump_url('"+temp_url+"');",1000);
}
}else{
alert(igd.make_err_msg(data));
}
});
}
function jump_url(url){
location.href="http://"+url;
}
</script>
|
|