A project includes a list page, including functions such as "Move Up", "Move down", and "delete" in the list. For the user experience, operations were implemented using JS recently, A list page is included. operations are implemented using JS for the user experience, including moving up, moving down, deleting, and other functions in the list. AJAX is used for front-end JS and back-end data modification, this article mainly describes the front-end JS.
Take a look at
Let's take a look at its HTML structure. Of course, this is related to the front-end cut graph. The back-end program staff is only responsible for writing their own JS. I will take our project as an example and take a look at the HTML
Content1:2013 overtime .txt
9:54:00
Move up Move Down Delete
Content2:Usage instructions. txt
9:54:00
Move up Move Down Delete
Content3:Master account. txt
9:54:00
Move up Move Down Delete
Content4:Sorting question .txt
9:54:00
Move up Move Down Delete
Next, let's take a look at the JS Code, mainly implemented using the JQ on method, because the list data is static for the first time (bind). After sorting, the data changes to dynamic (live). Therefore, this structure can only be used on. Let's take a look at the code.