TAILIEUCHUNG - Publishing AJAX and PHP - part 25

Khi bỏ một nhiệm vụ trên đây để DROP khu vực DELETE, xác nhận được yêu cầu trước khi số tiền thu được ứng dụng với việc xoá bỏ thực tế, như thể hiện trong hình sau đây | AJAX Drag and Drop Let s take a look at how this is going to look Figure Add Reorder and Delete Tasks in a Simple Visual Interface Dragging items around the screen makes the other items switch positions. 240 Chapter 10 When dropping a task on the DROP HERE TO DELETE area a confirmation is required before the application proceeds with the actual deletion as shown in the following figure Figure Confirmation Required Before Deleting a Task Time for Action Task Management Application with AJAX 1. Connect to the ajax database and create a table named tasks with the following code CREATE TABLE tasks id INT UNSIGNED NOT NULL AUTO_INCREMENT order_no INT UNSIGNED NOT NULL default 0 description VARCHAR 100 NOT NULL default PRIMARY KEY id 2. In your ajax folder create a new folder named drag-and-drop. 3. In the drag-and-drop folder create a file named and add the database configuration code to it php defines database connection data define DB_HOST localhost define DB_USER ajaxuser define DB_PASSWORD practical define DB_DATABASE ajax 241 AJAX Drag and Drop 4. Now add the standard error-handling file . Feel free to copy this file from previous chapters. Anyway here s the code for it php set the user error handler method to be error_handler set_error_handler error_handler E_ALL error handler function function error_handler errNo errStr errFile errLine clear any output that has already been generated if ob_get_length ob_clean output the error message error_message ERRNO . errNo . chr 10 . TEXT . errStr . chr 10 . LOCATION . errFile . line . errLine echo error_message prevent processing any more PHP scripts exit 5. Download the library from http downloads and unzip untar the downloaded archive to your drag-and-drop folder. Change the folder name from something like to simply scriptaculous. 6. Create a new file named and add this code to it php requi re_once .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.