function check() { if(document.guestbook.guest_name.value=="") { alert("姓名不能为空"); document.guestbook.guest_name.focus(); return false } if(document.guestbook.guest_email.value==""&&document.guestbook.guest_email.value=="") { alert("邮箱和电话不能同时为空"); return false } if(document.guestbook.content.value=="") { alert("内容不能为空"); document.guestbook.content.focus(); return false } if(document.guestbook.checkcode.value=="") { alert("验证码不能为空"); document.guestbook.checkcode.focus(); return false } return true; } function tab_menu(t){ $('.tabc').css('display','none'); var ids=$(t).attr('id'); $('#'+ids+'_c').css('display','block'); $('.tab').attr('class','tab'); $(t).addclass('active'); } function showproduct(showid){ $.ajax({ type: "post", data:'pid='+showid, url: site_url+"product/getproduct", datatype:'json', success: function(msg){ $('.ptitle').text(msg.data.title); $('#sort').text(msg.data.sort); $('#price').text(msg.data.price); $('#proinfo_c').html(msg.data.content); pid=msg.data.id; } }); }