23001 Posts in 11702 Topics by 2827 members
|Go to End|
4 April 2009 at 4:08am
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?
Thanks in advance,
4 April 2009 at 5:35am
Hm. What Version of jQuery are you using? The $.load() function does have an optional callback function, so you should be fine with that.
Or just use the $.get function:
9 April 2009 at 10:48pm
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.
8 May 2009 at 2:03am
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 ))
17 September 2009 at 6:47am
Hey, I've been puzzling through the Recipes:Ajax tutorial and cannot seem to get it to work. I was wondering if you have a live example of your work with Jquery requests.
|Go to Top|