Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个程序可以从用户那里获取详细信息,然后当用户单击提交时,详细信息将发送到数据库并返回信息。如果没有可返回的内容,例如没有他们正在搜索的人,那么我希望将一条错误消息发布在搜索结果将发布到的表中。
尝试这个
if(noresults found){ $('#myTable').empty() var newRow = $("<tr><td>no results found</td></tr>"); $("#myTable").append(newRow); } else { //proceed with your logic }