window object in processingjs
is there any way to access the window object in khanacademy's processingjs? there are so many things i would like to do such as asynchronous code (setTimeout), sessionStorage, and more
also if not then :(
is there any way to access the window object in khanacademy's processingjs? there are so many things i would like to do such as asynchronous code (setTimeout), sessionStorage, and more
also if not then :(
in processing js, you could use the draw function to create animated programs, if you have not yet taken the intro to Processing JS, I would really suggest starting there.
(if you wanna do setTimeOut you could try this piece of code:
var start = *unit of time*();
draw = function() {
if(*unit of time from the var above*() - start >= *the time to run the code below*) {
*the code to run when the time is up*
}
};
I'm not necesarly good at DOM, but I think this is it, the code in the draw function will only be ran once.
found the answer
var window=function(){return this;}();
i think that works
Vui lòng đăng nhập để lại bình luận.