• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calling the right method after ajax call

#11
[eluser]stoefln[/eluser]
[quote author="pistolPete" date="1234726403"]Another thought:
Why do you have to respond with the updated image list?
You could only respond with (e.g.) a JSON "true"/"false" success message, then the ajax script would react and reload the image list by directly calling the appropriate controller function.[/quote]
No bad idea. but i would have to make 2 requests instead of one.
Anyway- thanks for your thoughts.

#12
[eluser]obiron2[/eluser]
I agree with PistolPete.

Refresh the browser once Ajax has confirmed tha action was successful.

Deleting the image and refeshing the screen are two different functions. The refresh function could be potentially called from a number of places. (add an image, change an image name etc.)

You could do this as a pass through request, but it is easier to manage as single actions.

Alternatively you could flash the current page to the cookie and refresh from there.

#13
[eluser]stoefln[/eluser]
[quote author="obiron2" date="1234808729"]
Alternatively you could flash the current page to the cookie and refresh from there.[/quote]
could you explain this a bit more in detail?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.