To pass a function to setTimeout that is binded to an object of choice, to
something along these lines:
// where obj is obviously your object
var func = function() {
this.doSomething()
}.bind( this );
window.setTimeout( func, 1000 );
Function.prototype.bind is a function that's defined in the
I'm sorry, I made some typos. This is correct:
// where obj is obviously your object
var func = function() {
this.doSomething()
}.bind( obj );
window.setTimeout( func, 1000 );
Daan
On Thu, Dec 3, 2009 at 15:28, Daan Mortier wrote:
> To pass a function to setTimeout that is bind
On Sat, Mar 13, 2010 at 02:43, JoJo wrote:
> I'm doing some cross-site AJAX hack by dynamically inserting a script
> tag. […]
> On every browser but IE6, this works.
Personally, I load in the content via XmlHttp, and insert it into a
tag. There are some things to take into account when doing this
JoJo:
> I'm doing some cross-site AJAX hack by dynamically inserting a script
> tag. This script tag loads a PHP script that prints out javascript:
Me:
> Personally, I load in the content via XmlHttp, and insert it into a
> tag. There are some things to take into account when doing this. The
> ins