Skip to content

How To Write a JS3 Class

fahimc edited this page Sep 4, 2011 · 6 revisions

When creating a Class you need to wrap it around the following code. The Reason for this is to automatically execute this blank function.

(function(window) { function SearchView() {

} window.SearchView = SearchView; }(window));

It is important to remember that in order to access the new class you need to create an instances of it and make it accessible globally. This is the line which insures that happens.

window.SearchView = SearchView;

Clone this wiki locally