javascript - Retrieving data from database on click -


i have raphael circle in page , want retrieve data database when circle clicked.

my piece of code purpose is:

var circle = r.circle(x, y, 10).click(retrievedata()); 

the problem is, function retrievedata called when creating circle , not when circle clicked. how can write piece of code, runs retrievedata if circle clicked , not on creation of object?

functions in events of raphael (like event driven paradigms) needs passed delegate (function pointer / function variable name.)

use following code (note absence of brackets after retrievedata function.)

var circle = r.circle(x, y, 10).click(retrievedata); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -