dimanche 17 janvier 2016

Clean way of handling Ajax based pages

Traditionally I use to do following for my ajax based pages using jQuery.

  1. Load the page from server response on first time
  2. On certain user triggered event i make ajax call to my PHP script
  3. PHP script does it working and return the response in JSON
  4. On ajax::success callback, I mess up removing the old div entering new div change text etc etc.

The 4th point makes my coding very messy and i have to do a lot of efforts coding both sides.

How senior devs handles these issues so that they make ajax sites plus a neat, formatted, structured and readable codes.

Is there any other thing in Javascript that addresses these issues.

or in other words , does Angular, Backbone and Ember are introduced for this purpose ?

Thanks




Aucun commentaire:

Enregistrer un commentaire