我想传入o_id
数据,但是当我尝试它时会显示错误:
参考错误:左侧无效分配
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
$("#assign").click(function(){
params = ""
$("td[contentEditable='true']").each(function(){
if($(this).text() != "") {
if(params != "") {
params += "&";
}
params += $(this).data('id')+"="+$(this).text();
}
});
if(params!="") {
var o_id = <?php echo $o_id ?>;
$.ajax({
url: "assign_product.php",
type: "POST",
data:params+'&o_id'=o_id,
success: function(response){
$("#ajax-response").append(response);
$("td[contentEditable='true']").text("");
}
});
}
});
</script>
您在这一行有语法错误:
data:params+'&o_id'=o_id,
该=
标志必须在引号内。这是因为您有关于 的消息assignment
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句