tailieunhanh - Ajax For Dumies phần 4

Tham khảo tài liệu 'ajax for dumies phần 4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 3 Getting to Know Ajax Jn This Chapter Developing an Ajax application Getting XML from the server Working with the XMLHttpRequest object Passing data to the server by using Ajax Getting data from the server with the GET method Getting data from the server with the POST method f ook at that the CEO hollers. No wonder users don t like making MW purchases on our site. The page is always flickering. That s because you re refreshing the page each time you get more data you say calmly coming out of the shadows. Who are you the CEO cries. A master Ajax programmer you reply. And my rates are quite reasonable. For a major corporation anyway. Can you solve that perpetual flickering asks the CEO. Certainly you say for a hefty price. Anything the design team says. You sit down at the computer and calmly take over. This you think is going to be good. And the money s not half bad either. All it s going to take is a little Ajax in the right places and the problem is as good as solved. This chapter is where you start coding some Ajax. You re going to start working with the XMLHttpRequest object in depth here and in the next chapter. This chapter gives you a working knowledge of Ajax from the very beginnings all the way up to sending and receiving data to and from the server. 76 Part II Programming in Ajax Writing Some Ajax To illustrate Ajax the code in Listing 3-1 asks the user to click a button fetches data from the server using Ajax techniques and displays that data in the same Web page as the button without refreshing the page. Check out the code first and then check out the explanation that follows it. Listing 3-1 A First Ajax Application html head title Ajax at work title script language javascript var XMLHttpRequestObject false if XMLHttpRequestObject new XMLHttpRequest else if XMLHttpRequestObject new ActiveXObject function getData dataSource divID if XMLHttpRequestObject var obj .

TÀI LIỆU MỚI ĐĂNG
309    135    0    02-12-2024