TAILIEUCHUNG - Mobile Web Development phần 10

với một tin nhắn trong một định dạng cụ thể. Mã ngắn có thể được chia sẻ bởi nhiều nhà cung cấp dịch vụ, và do đó các tin nhắn có thể chứa từ khóa đó sẽ quyết định rằng nó có nghĩa là cho POTR. Cùng với các từ khóa, nó cũng sẽ có thông tin đặt hàng. | Mobile AJAX 3. When the user clicks the link she or he will see the form. On clicking the button in the form we are calling a JavaScript function SubmitComment . What we need to do in this function is get the recipeid from the hidden form that the AJAX call has sent collect other variables from the comment form and send them to the recipeHandler. function SubmitComment frm Copy the recipeld value from the hidden form received from AJAX to the comment form var src var target var url action recipeHandler what comment url recipeId url submitter url submitterPhone url comment ShowDetails url commentForm false false 4. Now we can write the back end code to save the comment to the table. It s straightforward now that we have created the RecipeComment class. We need to add code to the recipeHandler to save the comment when the value of the what variable is comment We can populate the class with the data coming in the request set the date and save it. Below is the code. else if _REQUEST what comment rc new RecipeComment recipeComments _REQUEST rc- dateUpdated date Y-m-d H i s if rc- Save echo p Comment saved. p else echo p Could not save your comment. p 5. The following screenshot shows how submitted comments and our form may display in a mobile browser. It s actually just like any other browser And if we want to make it a bit more interesting we can send back the actual comment in the output along with the message that the comment was saved. This will display the comment to the user giving her or him instant gratification That s what we want isn t it 196 Chapter 10 What s the Deal with All that Form Code The biggest piece in the comments code is the form processing. It s the JavaScript way of accessing values from form elements. The source and target bit are simply pointers to two forms. The source form is the one we got from the .

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.