大佬教程收集整理的这篇文章主要介绍了php – Jquery ajax很慢,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是代码:
$("#search").keyup(function(){ var value = $(this).val(); var categ = $("#categ").val(); if (value.length >= 1) { $.ajax({ type: "POST",url: "../core/search.php",data: { String : value,categ : categ },success: function(result){ $(".each_movie").hide(); $(".search_movie").remove(); $("#movies").append(result); } }); } else { $(".each_movie").show(); $(".search_movie").remove(); } });
和php
$src = $_POST['String']; $categ = $_POST['categ']; $sql = mysql_query("SELECT * FROM movies WHERE `$categ` LIKE '%".$src."%' ") or die(mysql_error()); while ($sql_grab = mysql_fetch_assoc($sql)) { ?> <div class="search_movie"> <p style="margin-bottom:5px;font-family:'Lucida Sans Unicode','Lucida Grande',sans-serif;color:rgba(255,255,0.3);font-size:12px;">Din: <?php echo $sql_grab['airdate']; ?> in cinematografe.</p> <table> <tr> <td rowspan="2" valign="top"><img class="main_pic" src="<?php echo $sql_grab['mainpic']; ?>" width="180px" /></td> <td><p class="name"><?php echo $sql_grab['name']; ?></p></td> </tr> <tr> <td><div class="desc_wrapper" id="<?php echo $id; ?>" style="display:inline-block;"><p class="desc"><?php echo mysql_real_escape_String($sql_grab['description']); ?></p></div><p nr="<?php echo $id; ?>" id="more<?php echo $id; ?>" class="more" style="position:absolute;margin:30px 2px;color:rgba(255,0.2);cursor:pointer;display:inline-block">...citeşte</p></td> </tr> </table> </div><!--each movie end--> <?php }
以上是大佬教程为你收集整理的php – Jquery ajax很慢全部内容,希望文章能够帮你解决php – Jquery ajax很慢所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。