如何将已经上搜索出来的结果按照用户的意愿排序?
就想淘宝中搜索出来一样东西,还可以将已经搜出来的结果根据价钱、销量等排序是怎么做到的?麻烦说具体点
比如我做的这个,比如我点一下这个价格 然后就把刚才已经搜出来的东西给他按价格排序
我是这样写的:
价格↑
销量↓
到货时间↓
<script></script>
<script> <br /> <br /> $(document).ready(function(){ <br /> $("#price").click(function(){ <br /> <br /> $.get("obj_search.php" ,{order:'obj_price'},function(response) <br /> { <br /> $("#show").hide(); <br /> $("#show").html(response); <br /> }) <br /> }); <br /> }); <br /> <br /> <br /> <br /> <br /> </script>
把这个order值传到一个PHP文件里 那哪里搜出来结果 然后再返回来,但是总是出现这个
回复讨论(解决方案)
这个js警告在jquery很常见,不用管他
排序就是定义好一个变量order=1,2,3,...对应不同排序方法,点击按钮的链接在后面加上&order=x传给php,在数据库查询列表的语句中根据order变量不同的值 加入order by price等等排序语句
看你是js排序,还是数据库排序。
如果是js排序,只能排当前页。
数据库排序则可以比较准确,按全部记录来排。
click点击触发ajax用post传值php返回data
获取点击的值,通过ajax传递到服务端,服务端通过sql处理,返回数据到页面展示。
通过ajax传递参数到服务器端,同时传入的除了排序字段,还有升降情况
后端使用order by ** desc或者order by asc进行查询,返回的结果可以是html元素内容,也可以是xml或者json串,客户端再通过js进行处理
通过ajax传递参数到服务器端,同时传入的除了排序字段,还有升降情况
后端使用order by ** desc或者order by asc进行查询,返回的结果可以是html元素内容,也可以是xml或者json串,客户端再通过js进行处理
也可以不通过ajax,直接给元素添加描点,进行整个页面的刷新
通过ajax传递参数到服务器端,同时传入的除了排序字段,还有升降情况
后端使用order by ** desc或者order by asc进行查询,返回的结果可以是html元素内容,也可以是xml或者json串,客户端再通过js进行处理
也可以不通过ajax,直接给元素添加描点,进行整个页面的刷新
什么叫描点
通过ajax传递参数到服务器端,同时传入的除了排序字段,还有升降情况
后端使用order by ** desc或者order by asc进行查询,返回的结果可以是html元素内容,也可以是xml或者json串,客户端再通过js进行处理
也可以不通过ajax,直接给元素添加描点,进行整个页面的刷新
什么叫描点 就是a标签

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

With the rapid development of social media, Xiaohongshu has become one of the most popular social platforms. Users can create a Xiaohongshu account to show their personal identity and communicate and interact with other users. If you need to find a user’s Xiaohongshu number, you can follow these simple steps. 1. How to use Xiaohongshu account to find users? 1. Open the Xiaohongshu APP, click the "Discover" button in the lower right corner, and then select the "Notes" option. 2. In the note list, find the note posted by the user you want to find. Click to enter the note details page. 3. On the note details page, click the "Follow" button below the user's avatar to enter the user's personal homepage. 4. In the upper right corner of the user's personal homepage, click the three-dot button and select "Personal Information"

This article will introduce how to sort pictures according to shooting date in Windows 11/10, and also discuss what to do if Windows does not sort pictures by date. In Windows systems, organizing photos properly is crucial to making it easy to find image files. Users can manage folders containing photos based on different sorting methods such as date, size, and name. In addition, you can set ascending or descending order as needed to organize files more flexibly. How to Sort Photos by Date Taken in Windows 11/10 To sort photos by date taken in Windows, follow these steps: Open Pictures, Desktop, or any folder where you place photos In the Ribbon menu, click

In Ubuntu systems, the root user is usually disabled. To activate the root user, you can use the passwd command to set a password and then use the su- command to log in as root. The root user is a user with unrestricted system administrative rights. He has permissions to access and modify files, user management, software installation and removal, and system configuration changes. There are obvious differences between the root user and ordinary users. The root user has the highest authority and broader control rights in the system. The root user can execute important system commands and edit system files, which ordinary users cannot do. In this guide, I'll explore the Ubuntu root user, how to log in as root, and how it differs from a normal user. Notice

Outlook offers many settings and features to help you manage your work more efficiently. One of them is the sorting option that allows you to categorize your emails according to your needs. In this tutorial, we will learn how to use Outlook's sorting feature to organize emails based on criteria such as sender, subject, date, category, or size. This will make it easier for you to process and find important information, making you more productive. Microsoft Outlook is a powerful application that makes it easy to centrally manage your email and calendar schedules. You can easily send, receive, and organize email, while built-in calendar functionality makes it easy to keep track of your upcoming events and appointments. How to be in Outloo

How does Xianyu search for users? In the software Xianyu, we can directly find the users we want to communicate with in the software. But I don’t know how to search for users. Just view it among the users after searching. Next is the introduction that the editor brings to users about how to search for users. If you are interested, come and take a look! How to search for users in Xianyu? Answer: View details among the searched users. Introduction: 1. Enter the software and click on the search box. 2. Enter the user name and click Search. 3. Select [User] under the search box to find the corresponding user.

How to use Baidu Advanced Search Baidu search engine is currently one of the most commonly used search engines in China. It provides a wealth of search functions, one of which is advanced search. Advanced search can help users search for the information they need more accurately and improve search efficiency. So, how to use Baidu advanced search? The first step is to open the Baidu search engine homepage. First, we need to open Baidu’s official website, which is www.baidu.com. This is the entrance to Baidu search. In the second step, click the Advanced Search button. On the right side of the Baidu search box, there is

sudo (superuser execution) is a key command in Linux and Unix systems that allows ordinary users to run specific commands with root privileges. The function of sudo is mainly reflected in the following aspects: Providing permission control: sudo achieves strict control over system resources and sensitive operations by authorizing users to temporarily obtain superuser permissions. Ordinary users can only obtain temporary privileges through sudo when needed, and do not need to log in as superuser all the time. Improved security: By using sudo, you can avoid using the root account during routine operations. Using the root account for all operations may lead to unexpected system damage, as any mistaken or careless operation will have full permissions. and

In the era dominated by intelligence, office software has also become popular, and Wps forms are adopted by the majority of office workers due to their flexibility. At work, we are required not only to learn simple form making and text entry, but also to master more operational skills in order to complete the tasks in actual work. Reports with data and using forms are more convenient, clear and accurate. The lesson we bring to you today is: The WPS table cannot find the data you are searching for. Why please check the search option location? 1. First select the Excel table and double-click to open it. Then in this interface, select all cells. 2. Then in this interface, click the "Edit" option in "File" in the top toolbar. 3. Secondly, in this interface, click "
