Re: [Proto-Scripty] IE6 cannot run dynamicly inserted script tag

2010-03-16 Thread Daan Mortier
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
 insertBefore trick is based on information from John Resig.

I must've been really sleeping, because I did not add ANY new
information for you in my reply =]

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] this and setTimeout in Prototype-based class

2009-12-04 Thread Daan Mortier
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 Prototype
library. Hope this helps.

Daan

On Wed, Dec 2, 2009 at 15:25, fma f...@gbiloba.org wrote:

 Hi,

 I'm new to Prototype. I'm using it to write a little application for
 our photoclub. Its goal is to allow users to upload photos, and then
 vote for them.

 I display all the thumbs, and a double-click on a thumb opens the
 photo in full-screen (in a div). As the photo can take time to load, I
 use setTimeout() to delay the display. The code looks like:

 But it does not work. In the _show() method, the call to
 this._flashNavButtons() leads to an error (this._flashNavButtons() is
 not a function). I think I understand why: when called from the
 timeout mecanism, 'this' no longer exists, or does not point anymore
 on my object...

 Is there a way to pass 'this' in the timeout callback? I also use such
 timeout callback to make the navgation buttons blink 3 times when the
 photo is opened in full size…


--

You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.




Re: [Proto-Scripty] this and setTimeout in Prototype-based class

2009-12-04 Thread Daan Mortier
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 daanmort...@gmail.com wrote:

 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 Prototype
 library. Hope this helps.

 Daan

 On Wed, Dec 2, 2009 at 15:25, fma f...@gbiloba.org wrote:

  Hi,

 I'm new to Prototype. I'm using it to write a little application for
 our photoclub. Its goal is to allow users to upload photos, and then
 vote for them.

 I display all the thumbs, and a double-click on a thumb opens the
 photo in full-screen (in a div). As the photo can take time to load, I
 use setTimeout() to delay the display. The code looks like:

 But it does not work. In the _show() method, the call to
 this._flashNavButtons() leads to an error (this._flashNavButtons() is
 not a function). I think I understand why: when called from the
 timeout mecanism, 'this' no longer exists, or does not point anymore
 on my object...

 Is there a way to pass 'this' in the timeout callback? I also use such
 timeout callback to make the navgation buttons blink 3 times when the
 photo is opened in full size…



--

You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.