-1
我有一个jquery后这样字符串返回的数据
jQuery.post("script_myrequisition.php", {"user_empno":user_no}, function(data) {
jQuery('#type2').html(data);
var pageHtml =jQuery (data);
if(substr(pageHtml,0,2)=='No'){ jQuery('#cancel').hide();}
else{ jQuery('#cancel').show();}
});
下面的HTML我有这样的邮寄方法返回
<input id='cancel' name='cancel' type='Submit' value='Cancel Selected' />
数据包含要么“没有找到记录”或“总记录数= x,后面是表格形式的记录“。
这不起作用。取消按钮不显示。请帮助
你为什么这样做'pageHtml =的jQuery(数据);' –
试'jQuery.post( “script_myrequisition.php”,{ “user_empno”:user_no },功能(数据){ jQuery的( '#2型')的html(数据); 变种pageHtml =。 jQuery(data); if(data.substring(0,2)=='No'){ jQuery('#cancel')。hide(); } else { jQuery('#cancel')。show(); } });' –
我简单地使用了数据。它不起作用。在这两种情况下,javascript错误说对象需要 – mansoondreamz