Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
moust committed May 9, 2014
1 parent 90b82d4 commit 4564f08
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,33 @@ You can find an explanation on how to do this in the following page : [Preparing

# Using

The file is returned to a success callback as a base64 encoded string that you can use like in the example below or with the File API.
The file is returned to a success callback as URL object that you can use like in the example below or with the File API.

```
XAPKReader.get(filename, successCallback, [errorCallback]);
XAPKReader.get(filename, successCallback, [errorCallback], [fileType]);
```

## Parameters

- **filename** : The name of the file to load form the expansion file
- **successCallback** : The callback that executes when the file is loaded.
- **errorCallback** (Optional) : The callback that executes if an error occurs.
- **fileType** (Optional) : The file type.

## Example

```javascript
XAPKReader.get(
'image.jpg',
function (data) {
function (url) {
var img = new Image();
img.src = "data:image/png;base64," + data;
img.src = url;
document.body.appendChild(img);
},
function (error) {
console.error(error);
}
},
'image/jpeg'
);
```

Expand Down

0 comments on commit 4564f08

Please sign in to comment.