reason property (event)
Sets or retrieves an integer value that indicates whether the data transfer was successful or not. Use this property with ondatasetcomplete events.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
Possible values:
Integer that specifies or retrieves the transfer state.
One of the following values:
Transfer is successful. | |||||||
Transfer has aborted. | |||||||
Some error has occurred during data transfer. |
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the reason property:
|
|||||
<head> <script type="text/javascript"> function HandleData () { switch (event.reason) { case 0: alert ("Transfer is successful."); if (event.qualifier == "") { alert ("No default data member is specified."); } else { alert ("The name of the default data member is: " + event.qualifier); } break; case 1: alert ("Transfer has aborted."); break; case 2: alert ("Some error has occurred during data transfer."); break; } } </script> </head> <body> <xml src="news.xml" ondatasetcomplete="HandleData ();"></xml> </body> |
|||||
|
|||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments