我在返回值时遇到连接问题。
return "<a class='btn btn-xs btn-block btn-success' href='javascript:void(0)'
onClick='chk()' >Verify By Support</a>"
我想要做的是在onclick chk函数中放入一段代码。
<?php echo base_url(); ?>fieldwork/verify_troubleshoot_support/oObj.aData[1]
/oObj.aData[15]
我到目前为止所尝试的是
return "<a class='btn btn-xs btn-block btn-success' href='javascript:void(0)'
onClick='chk("+<?php echo base_url()?>fieldwork"+/"+verify_troubleshoot_support+"/"+Obj.aData[1]+"/"+Obj.aData[15]+")' >Verify By Support</a>"
但我收到错误
答案 0 :(得分:2)
将fieldwork"+/"
更改为fieldwork+"/"
如果为了简单起见,首先将其分配给variabale
会更好。
<强>已更新强>
var data = "<?php echo base_url()?>fieldwork/"+verify_troubleshoot_support+"/"+Obj.aData[1]+"/"+Obj.aData[15];
return "<a class='btn btn-xs btn-block btn-success' href='javascript:void(0)'
onClick='chk(data)' >Verify By Support</a>";
答案 1 :(得分:0)
变化:
return "<a class='btn btn-xs btn-block btn-success' href='javascript:void(0)' onClick='chk("+<?php echo base_url()?>fieldwork"+/"+verify_troubleshoot_support+"/"+Obj.aData[1]+"/"+Obj.aData[15]+")' >Verify By Support</a>"
为:
return "<a class='btn btn-xs btn-block btn-success' href='javascript:void(0)' onClick='chk("+<?php echo base_url()?>fieldwork+"/"+verify_troubleshoot_support+"/"+Obj.aData[1]+"/"+Obj.aData[15]+")'>Verify By Support</a>"