User Tools

Site Tools


en:code:data:web

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:code:data:web [2011/10/01 22:53] – [Web] jmgren:code:data:web [2021/02/13 11:23] (current) – external edit 127.0.0.1
Line 17: Line 17:
     * onDownloadProgress - ([[#onDownloadProgress|onDownloadProgress]]) called when the download progresses     * onDownloadProgress - ([[#onDownloadProgress|onDownloadProgress]]) called when the download progresses
     * onError - ([[#onError|onError]]) called when an error has occured     * onError - ([[#onError|onError]]) called when an error has occured
-    * file - ([[en:code:data:file|File]] or string) the file or filename to use as a destination for the downloaded data+    * file - ([[en:code:data:file|File]] or string) the file or filename to use as a destination for the downloaded data, if this is not set the data will be stored into RAM
  
 === Example === === Example ===
Line 64: Line 64:
 === Notes === === Notes ===
 This method is asynchronous, this means that it will return before the data is downloaded. This method is asynchronous, this means that it will return before the data is downloaded.
-To known when this is done use the [[#onFinished|onFinished]] event or the [[#isDownloading|isDownloading]] method.+To know when this is done use the [[#onFinished|onFinished]] event or the [[#isDownloading|isDownloading]] method.
  
 ==== isDownloading ==== ==== isDownloading ====
Line 103: Line 103:
  
 === Arguments === === Arguments ===
-  - encoding - ([[code:core:global#encoding|Encoding]]) the encoding to use+  - encoding - ([[en:code:core:global#encoding|Encoding]]) the encoding to use
  
 === Returns === === Returns ===
Line 135: Line 135:
 === Returns === === Returns ===
   * (Web) this Web   * (Web) this Web
 +
 +===== Events =====
 +
 +==== onFinished ====
 +Called when the data has been downloaded.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.onFinished = function() {};
 +</code>
 +
 +=== Example ===
 +<code javascript>
 +myObject.onFinished = function()
 +{
 + //Event action
 +};
 +</code>
 +
 +==== onDownloadProgress ====
 +Called when the download progression has changed.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.onDownloadProgress = function(bytesReceived, bytesTotal) {};
 +</code>
 +
 +=== Arguments ===
 +  - bytesReceived - (integer) received byte count
 +  - bytesTotal - (integer) total byte count
 +
 +=== Example ===
 +<code javascript>
 +myObject.onDownloadProgress = function(bytesReceived, bytesTotal)
 +{
 + //Event action
 +};
 +</code>
 +
 +==== onError ====
 +Called when an error occurs.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.onError = function(errorText) {};
 +</code>
 +
 +=== Arguments ===
 +  - errorText - (string) a text describing the error
 +
 +=== Example ===
 +<code javascript>
 +myObject.onError = function(errorText)
 +{
 + //Event action
 +};
 +</code>
 +
 +===== Enumerations =====
 +
 +==== Method ====
 +The download method.
 +
 +=== Values ===
 +  - Get: use "get" method (default)
 +  - Post: use "post" method
en/code/data/web.1317509593.txt.gz · Last modified: 2021/02/13 11:23 (external edit)