Access member method from async call

<>

This question already has an answer here:

Answers


I suppose your readerOnLoad function is called in a different context than you expect, and you end up with a this value which is not an instance of FileProcessor.

Try this:

reader.onload = this.readerOnload.bind(this);

Or, if you must support older browsers:

var self = this;
reader.onload = function(e) { self.readerOnLoad(e); };

Need Your Help

Having problems with my OpenGL plane

c++ arrays opengl vertex

I'm having a bit of trouble with creating a plane (using GL_TRIANGLE) using vertex arrays.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.