jquery中post中地址参数中有问号?
jquery中post方法中问号表示后面紧跟的是参数名,比如: $.post("queryUser.do?userId=123",funciton(data.status){ ///// }) 这句话的意思是使用post请求调用接口querylist.do,并且传参数userId的值是123。这样到后台才能完成整个接口的请求。 参数的作用是:在post请求中带着请求参数要完成特定数据的处理,比如上面例子中只查询 id为123的用户信息,如果不带此参数就是返回全部的用户信息,这个要根据业务场景来设定。
jquery中post函数result.status是什麼意思?
服务器输出json对象echojson_encode(array('status'=>'1'));有值为真,执行if里面的语句【有两种接收方法result.status或result['status']】我一般这样用echojson_encode(array('status'=>'ok'));if(data.status=="ok"){alert('成功');}绝对正解
jquery中的submit方法怎么用?
submit()方法绑定在form表单元素上,当绑定的表单被提交时(通过点击按钮、按回车键等),会触发该方法。实例:
<form id="form1" autocomplete="off"> <input type="text" name="model.username"/> <input type="password" name="model.password"/> <input type="submit" value="登录" /> </form>
$('#form1').submit(function() { $.ajax({ url: '/index!login.do', data: $('#form1').serialize(), type: "POST", dataType: "json", cache: false, success: function(data) { if (data.login == true || data.login == "true") { // 登录成功 location.replace('/main/index.do'); } else { alert('登录失败!请检查用户名或密码'); } } });});
aspx中script脚本变量怎样向aspx.cs传值不用js方法?
用jquery的post方法 ,或者直接在js里声明一个变量,让回绑定这个变量到某个控件上,然后,在aspx.cs中用Reques.Params获取这个控件的值

