FancyPrairie
Programmer
I've created a javascript class (MyClass). In my html page I set var abc = new MyClass();
To simplify, MyClass looks something like this:
function MyClass() {
var c
c.currentDate = null; //line 1
c.IsDropDown = false; //line 2
...
code to dynamically add include files here, but the readyState of the include files must be set to "complete" before executing the next statement. //line 3
return c //line 4
}
How do I execute the code in line 3 and wait for it to finish before executing line 4?
I've tried using setTimeout and setInterval but can't seem to get them to work so that line 4 does not get executed until line 3 finished.
To simplify, MyClass looks something like this:
function MyClass() {
var c
c.currentDate = null; //line 1
c.IsDropDown = false; //line 2
...
code to dynamically add include files here, but the readyState of the include files must be set to "complete" before executing the next statement. //line 3
return c //line 4
}
How do I execute the code in line 3 and wait for it to finish before executing line 4?
I've tried using setTimeout and setInterval but can't seem to get them to work so that line 4 does not get executed until line 3 finished.