Welcome Guest, Not a member yet? Register   Sign In
Simple, I guess, AJAX question .
#1

[eluser]Unknown[/eluser]
Hello to everyone,
I am an Ajax Beginner and I would like to ask you a question.I have a controller that gets an items id, qty, name etc and adds it to cart -after clicking a specific link. After adding it, it redirects to the main page.

The controller action is sth like
Code:
public function add_to_cart($id){
...code...
}

i would like to ask you if there is a possiblity of adding AJAX to to this controller action in order to ADD the item to the cart but NOT to refresh the whole page after redirection (I dont want the "refresh event" to happen).

Is this possible?
#2

[eluser]noideawhattotypehere[/eluser]
Of course, thats whats ajax for. Read about jquery $.ajax, $.get, $.post and come back if you still have a problems implementing it. There is also library called cjax, but i have never used it.
#3

[eluser]Unknown[/eluser]
Thanks a lot , I will try it.




Theme © iAndrew 2016 - Forum software by © MyBB