jquery php 传值问题 我在一个script中写了这么一句话$.post("../common/toSession.php",{query:"123"});但是在tosession.php文件中我用$_POST['query']得不到‘123’这个值 为啥啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那我想知道 你是怎么知道得不到123这个值的呢?在tosession.php页面echo $_POST['query']script中$.post("../common/toSession.php",{query:"123"},function(x){ alert(x);}); 楼主alert得到是什么?{query:"123"}这个不是json? {"query":"123"} 6楼 +1 注意引号问题。另外检查一下文件路径。不行的话FIREBUG检查一下。 function generateQueryExcel2(form) { var str =''; var cookie =''; var joinction =''; var myquery =''; var whereclose = ''; $(".filterExcelcheck:checked").each(function() { str = str+ ' '+$(this).val()+' as '+$(this).val().replace('.','_')+' ,'; cookie = cookie+ ' c'+$(this).val()+'l'; }); $.cookie("exportExcel", null); $.cookie("exportExcel", cookie , {expires: 30, domain: '127.0.0.1'}); //extract the last char ',' str = str.slice(0,-1) // if dwo. existing if( str.indexOf('dwo.') >-1 ) joinction = "LEFT JOIN lte_dct_cr.cridetails cri ON cr.CR_Id = cri.CR_Id LEFT JOIN lte_dct_cr.DWOdetails dwo ON cri.CRI_Id = dwo.CRI_Id"; //else if "cri." existing else if(str.indexOf('cri.')>-1) joinction = "LEFT JOIN lte_dct_cr.cridetails cri ON cr.CR_Id = cri.CR_Id"; whereclose = form.whereclose.value; myquery = "SELECT"+str+"FROM lte_dct_cr.crdetails cr "+joinction+" "+whereclose; $.post("../common/toSession.php",{query:"123"}); $('.toExcel').html("<iframe height=0 width=0 src='../common/excel_CRExport.php' name='excel'>"+myquery+"</iframe>"); } 这个是完整的function, 就是用post传值到后台 可是就是没有用哦 路径我也写对的哦 是不是要啥插件? 怎么移动discuz7.0页头“注册 登录”的位置?? 打开数据库连接代码出现乱码? 求一本工作流方面的好书 ThinkPHP实现URL rewrite 找高手帮我开发网站 辞职了,散分 晕!utf-8编码zh-cn语言,生成页面时每个include产生一个问号 有偿寻求服务 if(date("His",$now) >= 235800)看看这么会由问题吗? PHP多个关联复选框 MYSQL 数据出错,求各大哥大虾解决。小弟感谢大哥们,在线等。。。 asp个人信息页面显示不正常,有对比图!请问如何处理呢??要修改哪个地方?
alert(x);
});
不行的话FIREBUG检查一下。
var str ='';
var cookie ='';
var joinction ='';
var myquery ='';
var whereclose = '';
$(".filterExcelcheck:checked").each(function() {
str = str+ ' '+$(this).val()+' as '+$(this).val().replace('.','_')+' ,';
cookie = cookie+ ' c'+$(this).val()+'l';
});
$.cookie("exportExcel", null);
$.cookie("exportExcel", cookie , {expires: 30, domain: '127.0.0.1'});
//extract the last char ','
str = str.slice(0,-1)
// if dwo. existing
if( str.indexOf('dwo.') >-1 ) joinction = "LEFT JOIN lte_dct_cr.cridetails cri ON cr.CR_Id = cri.CR_Id LEFT JOIN lte_dct_cr.DWOdetails dwo ON cri.CRI_Id = dwo.CRI_Id";
//else if "cri." existing
else if(str.indexOf('cri.')>-1) joinction = "LEFT JOIN lte_dct_cr.cridetails cri ON cr.CR_Id = cri.CR_Id";
whereclose = form.whereclose.value;
myquery = "SELECT"+str+"FROM lte_dct_cr.crdetails cr "+joinction+" "+whereclose;
$.post("../common/toSession.php",{query:"123"});
$('.toExcel').html("<iframe height=0 width=0 src='../common/excel_CRExport.php' name='excel'>"+myquery+"</iframe>");
}
这个是完整的function, 就是用post传值到后台 可是就是没有用哦 路径我也写对的哦 是不是要啥插件?