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 周銳 閱讀(468) 評論(0)  編輯  收藏 所屬分類: AjaxJavaScript
          主站蜘蛛池模板: 勃利县| 九台市| 来宾市| 永仁县| 三穗县| 股票| 丰都县| 阿克陶县| 黎川县| 大足县| 芦山县| 罗平县| 上林县| 东兴市| 澄江县| 阳江市| 井研县| 涟水县| 西城区| 达州市| 天长市| 丰宁| 靖安县| 博湖县| 定远县| 千阳县| 安吉县| 南岸区| 叶城县| 宁安市| 延长县| 西城区| 常熟市| 邛崃市| 石河子市| 沈阳市| 洪洞县| 花莲县| 宜兰市| 离岛区| 巩留县|