- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys, I want to make this code behave quasi-sync ie by the time it reaches the 2nd comment line below, it has finished reading the file. Please help...
var content ;
var oFile //this is got from a loop. No problem here
var reader = new FileReader();
reader .onload =function(e){
content = e.target.result ;}
reader .readAsBinaryString(oFile);
//make sure u have contents here
- Tags:
- HTML5
- Intel® XDK
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you solved the general problem that prompted your question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You'll probably want to use a promise. Makes all things asynchronous much easier.
See this:

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page