简体   繁体   English

如何添加更多..按钮来搜索结果

[英]How to add more.. button to search results

I'm creating a website that shows 20 search results from the searched query, by taking the results from the database. 我正在创建一个网站,该网站通过从数据库中获取结果显示20个搜索查询的搜索结果。 If, in the address bar, the user has $n=(number) the number of results would be that number. 如果在地址栏中用户具有$n=(number) ,则结果数将为该数字。 So I thought of creating a button that resends the request but with $n=$n+10 , but that would refresh the page and I want a way to keep the user on the page and show 10 more results quickly and easily. 因此,我想到了创建一个按钮来重新发送请求,但使用$n=$n+10 ,但这将刷新页面,并且我希望有一种方法可以使用户停留在页面上,并快速,轻松地显示10个结果。 Any ideas? 有任何想法吗?

There are only two ways. 只有两种方法。 Regular way that refreshes the page and ajax. 刷新页面和ajax的常规方法。 If you are new to Ajax, I suggest you to use jQuery functions. 如果您不熟悉Ajax,建议您使用jQuery函数。 It makes everything much easier to load that extra data and display them without refreshing the page. 它使一切变得更加容易,以加载额外的数据并显示它们而无需刷新页面。

http://api.jquery.com/category/ajax/ http://api.jquery.com/category/ajax/

I suggest you to start with jQuery.post() function since you are new to this. 我建议您从jQuery.post()函数开始,因为您是新手。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM