AJAX and PHP Building Responsive Web Applications phần 10

Bây giờ thêm tập tin lỗi xử lý tiêu chuẩn, . Cảm thấy tự do để sao chép tập tin này từ các chương trước. Dù sao, đây là mã cho nó: Tạo một file mới có tên là , và thêm mã này vào | 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 tasksli DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD xhtml1-transiti onal .dtd html xmlns http 1999 xhtml head meta http-equiv Content-Type content text html charset utf-8 title AJAX Drag and Drop Sortable List title link href rel stylesheet type text css script src type text javascript script script src scriptaculous lib type text javascript script script src scriptaculous src type text javascript script head body onload startup h1 Task Management h1 h2 Add a new task h2 div input type text id txtNewTask name txtNewTask siZe 30 maxlength 100 onkeydown handleKey event input type button name submit value Add this task onclick process txtNewTask addNewTask div br h2 All tasks h2 ul id tasksList class sortableList _onmouseup process tasksList updateList php myTasksList new TasksList echo myTasksList- BuildTasksList 242 Chapter 10 ul br br div id trash DROP HERE TO DELETE br br div body html 7. Create a new file named .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.