PDA

View Full Version : Where do I go with ajax?



Jas
02-15-2008, 04:23 AM
I just finished the ajax tutorial on w3schools website, and I got ajax to play with a php script-- I'm very happy :):):):):). But now what do I do to learn more? What good tutorials are out there? I am interested in AJAX and PHP, not really AJAX and ASP or any of that.

Twey
02-15-2008, 12:17 PM
AJAX is rarely necessary. Most data can be more efficiently and conveniently described by JSON.

The server-side language you're using doesn't matter (unless it's Ruby on Rails or you're using some library/framework that attempts to abstract away the client/server divide, in which case you need to find a new library/framework).

Beware W3Schools' tutorials, they're... er... less than exemplary.

There's not really much more to learn. It's all pretty simple stuff.

Jas
02-20-2008, 02:44 PM
AJAX is rarely necessary.
Right, but it does come in handy. Some features, like chat rooms, can be done using it. Maybe not well, but done none the less.


Beware W3Schools' tutorials, they're... er... less than exemplary.
True, but it helped.

I think I am getting the hang of AJAX now anyway. Thanks.

Twey
02-21-2008, 09:39 AM
Some features, like chat rooms, can be done using it. Maybe not well, but done none the less.It's much easier (and more efficient) to use JSON than XML for this purpose and many others. Situations where I'd actually choose to use XML are few and far between.

Jas
02-21-2008, 06:51 PM
It's much easier (and more efficient) to use JSON than XML for this purpose and many others. Situations where I'd actually choose to use XML are few and far between.
Wait, what are we talking about now? I need AJAX to communicate with the server, which does not always require XML. JSON looks more complicated at any rate, and I don't know if it can do that.

Twey
02-21-2008, 10:28 PM
I need AJAX to communicate with the server, which does not always require XML.AJAX = Asynchronous Javascript And XML. While asynchronicity is usually a good thing (since a synchronous request will block the UI), XML is usually overkill. JSON is more efficient as a data format (it can encode more data for less characters), and also simpler to manipulate (since an eval() on the string data will return a normal ECMAScript object that can be worked with like any other object, with no special functions required as for XML).

brentnicholas
02-21-2008, 10:58 PM
To clairify the conversation:

AJAX - allows you to make requests to the server without reloading the page.

JSON - a way to serialize data to be sent to the server or from the server on the AJAX request.

XML - Same thing, but not serialzed. Structured data instead.

Ajax Libraries - Allow you to get work done with out going mad over browser differences. Take a look at Prototype, jQuery or Dojo. They really really help!

To move forward I'd recommend that you do an amazon search for Ajax books.
I bought:
Prototype and Scriptaculous - Pragmatic Programmers
Prototype and Scriptaculous - Manning
Ajax in Practice - Manning
Ajax in Action - Manning
Pragmatic Ajax - Pragmatic Bookshelf

They are all very good and wide in breadth, the 3rd and 4th will go over alot of libraries and examples, as well as cover a lot of js stuff you need to know.

Now as for Ajax applications, I build intranets and extranets and use pretty much all Ajax (prototype/dojo) recently. Though I'll do hybrid of ajax widgets in a page sometimes, and other times full blown ajax applications. I make the choice based on where the user will be pulling the application from. We've got a lot of people out in remote locations so Ajax works great for those on slow connections. However, I am a bit spoiled by the fact that I have a captive audience and their environment is controlled.

Hope that helped a bit.

The main thing is.. keep at it... it will slowly make scense.
Do little 'example tests', keep them simple and just learn the concept, don't clutter up your tests with a alot of features.
Also, read about it everyday.... that's key..

BN

Twey
02-22-2008, 11:12 AM
AJAX - allows you to make requests to the server without reloading the page.In a very specific manner (asynchronously via XML).
JSON - a way to serialize data to be sent to the server or from the server on the AJAX request.

XML - Same thing, but not serialzed. Structured data instead.Both are structured.
Ajax Libraries - Allow you to get work done with out going mad over browser differences. Take a look at Prototype, jQuery or Dojo. They really really help!They do, but I would never recommend Prototype to anyone. Dōjō is good (I think), but very large, and very much overkill if you're only intending to do XHR with it. Try something simple and specialised, like Woosta's JIF (http://rick.measham.id.au/javascript/jif.js).