TAILIEUCHUNG - Practical prototype and scipt.aculo.us part 15

Practical prototype and part 15: The information in this book is distributed on an "as is" basis, without warranty Although every pre-caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. | 72 CHAPTER 4 AJAX ADVANCED CLIENT SERVER COMMUNICATION Figure 4-17. Slightly less ugly We re almost there. The last part is the easiest because it s built into . Instead of designating one container to update you can designate two one for successful requests and one for unsuccessful requests. The conventions followed by HTTP status codes make it easy to figure out what s an error and what s not. new success breakfast_history failure error_log insertion top parameters food_type waffles CHAPTER 4 AJAX ADVANCED CLIENT SERVER COMMUNICATION 73 Victory As Figure 4-18 shows bad requests show up bright red in the error log. Figure 4-18. Errors now look like errors. Now put that taste parameter back into the statement and watch your valid request appear in a pleasing green color as shown in Figure 4-19. new success breakfast_history failure error_log insertion top parameters food_type waffles taste delicious 74 CHAPTER 4 AJAX ADVANCED CLIENT SERVER COMMUNICATION Figure 4-19. Valid entries now look valid. Example 2 Fantasy Football It s time to talk about the site we ll be building together over the course of this book. JavaScript has a place on many different kinds of sites but web applications are especially ripe for applying the topics we ll cover in the pages ahead. So let s build a site that people need to use rather than just read. We ll build the sort of site that Ajax can have the greatest impact on. The App For the next few chapters we ll be building a fantasy football site. For those who don t know apologies to my non-American readers fantasy football is a popular activity among followers of professional American football. Here s fantasy football in a nutshell

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.