Tài liệu JavaScript & DHTML Cookbook

Thảo luận trong 'Lập Trình' bắt đầu bởi Thúy Viết Bài, 5/12/13.

  1. Thúy Viết Bài

    Thành viên vàng

    Bài viết:
    198,891
    Được thích:
    173
    Điểm thành tích:
    0
    Xu:
    0Xu
    It may be difficult to imagine that a technology born as recently as 1995 would have
    had enough of a life cycle to experience a rise and fall in popularity, followed now by
    an amazing renaissance. Client-side scripting, begun initially with JavaScript embedded
    in Netscape Navigator 2, has experienced such a roller coaster ride. A number of
    early incompatibilities among major browsers caused many a content author’s head
    to ache. But we learned to live with it, as a long period of stability in one platform—
    Internet Explorer 6, in particular—meant that we could use our well-worn compatibility
    workarounds without cause for concern. Another stabilizing factor was the
    W3C DOM Level 2 specification, which remained a major target for browser makers
    not following Microsoft’s proprietary ways. Mozilla, Safari, and Opera used the
    W3C DOM as the model to implement, even if Microsoft didn’t seem to be in a
    hurry to follow suit in all cases.
    Two factors have contributed to the rebirth of interest in JavaScript and Dynamic
    HTML. The first is the wide proliferation of broadband connections. Implementing
    large client-side applications in JavaScript can take a bunch of code, all of which
    must be downloaded to the browser. At dial-up speeds, piling a 50–75 kilobyte script
    onto a page could seriously degrade perceived performance; at broadband speeds,
    nobody notices the difference.
    But without a doubt, the major attraction these days is the now widespread availability
    in all mainstream browsers of a technology first implemented by Microsoft: the
    XMLHttpRequest object. It’s a mouthful (leading some to refer to it as, simply, XHR),
    but it allows background communication between the browser and server so that a
    script can request incremental data from the server and update only a portion of a
    page. It is far more efficient than downloading a bunch of data with the page and less
    visually disruptive than the old submit-and-wait-for-a-new-page process. To help put
    a label on the type of applications one can build with this technology, the term Asynchronous
    JavaScript and XML (Ajax) was coined. In truth, Ajax is simply a catchy
    handle for an existing technology.
     

    Các file đính kèm:

Đang tải...