Constructor
new FileReaderBase(source, localopt)
- Source:
Properties:
Name | Type | Description |
---|---|---|
source |
String | The source of the file. This is either a input element (type=file) or a URL. If it is a URL, set local to true. |
Creates an instance of FileReaderBase.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
source |
String | The source of the file. This is either a input element (type=file) or a URL. If it is a URL, set local to true. |
||
local |
Boolean |
<optional> |
true
|
A boolean indicating whether or not the source is local (a file input) or remote (a url). |
Methods
addEventListener(eventName, callback)
- Source:
Add an event listener.
Parameters:
Name | Type | Description |
---|---|---|
eventName |
String | The name of the event. |
callback |
function | A callback function associated with the event name. |
loaded(data)
- Source:
To be overwritten by inheriting classes.
Parameters:
Name | Type | Description |
---|---|---|
data |
any |
raiseEvent(eventName, data)
- Source:
Raise an event. To be called by inheriting classes.
Parameters:
Name | Type | Description |
---|---|---|
eventName |
String | The name of the event. |
data |
any | Data to be passed to the handler. |