pass additional parameters to event handler using Prototype.js

bindAsEventListener(scope, arg1, arg2,…)

example (all functions inside body script tags):

Event.observe(div, 'click', zoomToWard.bindAsEventListener(this, wardIndex));
function zoomToWard(evt, index){
	alert("index::: "+index);
	}
http://www.simpltry.com/?cat=2&paged=2

http://www.google.com/search?hl=en&q=pass+arguments+observe+prototype&btnG=Google+Search

in encytemedia
http://encytemedia.com/blog/articles/2006/02/08/working-with-events-in-prototype

typo - SWiK
http://swik.net/Typo+Prototype

		
Advertisements

2 Responses to “pass additional parameters to event handler using Prototype.js”

  1. hkadejo Says:

    Thank you!

  2. sanddesert88 Says:

    Thank you very much ! ^_^

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: