怎么在Jquery里面实现action页面js的传值?function ch() {
if ($(":checkbox:checked").length==0)
{
alert("请选择一行数据 "); }
else
{
"productdelete.action?pid="+$(":checkbox:checked").val;
alert("productdelete.action");
}
}
if ($(":checkbox:checked").length==0)
{
alert("请选择一行数据 "); }
else
{
"productdelete.action?pid="+$(":checkbox:checked").val;
alert("productdelete.action");
}
}
<input type="checkbox" name="a" value="1">
<input type="checkbox" name="a" value="2">
<input type="checkbox" name="a" value="3">
<input type="checkbox" name="a" value="4">
<input type="button" onclick="ch();" value="click"><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
function ch() {
if ($(":checkbox:checked").size()==0)
{
alert("请选择一行数据 ");
}
else
{
location.href = "productdelete.action?pid=" + $(":checkbox:checked").val();
}
}
</script>
url: '/Report/PeerInfo_ExportExcel/?t=' + radomnum(1000),
type: 'POST',
dataType: 'json',
data: sqlstr,//数据
timeout: 30000,
error: function () {
AlertMsg("系统出错,请重试!");
},
success: function (json) {
if (!json.iserror) {
...
}
}
});
$("#form")[0].submit();