I'm aware that I can use jQuery.load() request, but I need my js to trigger another function on success. Is there any way to do it in silverstripe?
What I'm trying to do is to get projects from my database based on their type. User selects the type of the project from the menu (on click), which in turn is passed to the php function. So far I managed to do it with jQuery.load(). However, I need the php function to return back to the template the result of this query and on success js function should update the template.
Do you have any idea how it can be done?
I use quite an old version of jQuery, as it has been given to me along other js files. I've just realized that it's very old!!!(jQuery 1.1.4 ). I will try it with the new version and will let you know about my findings. Thanks for your reply, I really appreciate it. :)
For all of you newbies like me having similar problem, just wanted to let you know that silverstripe works beautifully with ajax() request and other requests provided by JQuery. My mistake was in the way I entered the url. I simply pointed to the class then function instead of specifying just the function name. Check Ajax basics in recipes to clarify the issue. Hope, this will save some of you lots of time as oppose to me.
My website is almost ready :)))