posts - 431,  comments - 344,  trackbacks - 0

          Syntax
            new Ajax.Updater(container, url, options);
          // make a HTTP request to the specified URL and update the 'container' element.

          Note: to only update a div on success, you may optionally substitute a property list for a simply element id (ie {success:’div_name’} instead of ‘div_name’)

          Options

          Option Default value Description
          asynchronous true Type of request
          evalScripts false When set as “true”, scripts in requested url are evaluated
          method ‘post’ Lets you decide whether to use Get or Post for the request to the server
          contentType ‘application/x-www-form-urlencoded’ Allows you to set the content-type sent to the server
          encoding ‘UTF-8’ Allows you to determine the encoding type information given to the server
          parameters ’’ Allows you to attach parameters to your AJAX request. Most common: parameters:Form.serialize(this)
          postBody ’’ Specify data to post. Something like: postBody:’thisvar=true&thatvar=Howdy’ How does this differ from parameters?
          username ’’
          password ’’
          requestHeaders ’’ Allows you to override the headers, see the Prototype AJAX options for details
          onComplete ’’ Function to call on completion of request
          onSuccess ’’ Function to call on successful completion of request
          onFailure ’’ Function to call on failed request
          onException ’’ Function to call on failed request (e.g. attempted cross-site request)
          on + Status Code ’’ on404 etc. raise an event when given status code is encountered.
          insertion None Instead of inserting the response in the existing content (possibly overwriting it) you can pass a valid Insertion object, such as Insertion.Top, Insertion.Bottom, Insertion.Before or Insertion.After.

          Hint: If you have set evalScripts:true the script you call (the url parameter) must return a header of ‘Content-Type: text/javascript’ else the browser will not execute it.

          posted on 2008-03-18 17:49 周銳 閱讀(471) 評論(0)  編輯  收藏 所屬分類: AjaxJavaScript
          主站蜘蛛池模板: 汉寿县| 梁河县| 清苑县| 雅安市| 中卫市| 黑龙江省| 疏附县| 阳春市| 澄迈县| 姜堰市| 黄平县| 八宿县| 陇西县| 遵义市| 读书| 鸡泽县| 克拉玛依市| 安西县| 陇西县| 江油市| 济宁市| 西华县| 高邑县| 钟山县| 绥宁县| 威宁| 山阳县| 常山县| 庆城县| 五河县| 通渭县| 嘉定区| 炉霍县| 涿鹿县| 江永县| 治多县| 靖宇县| 大丰市| 阜南县| 浦城县| 富阳市|