|
|
Ajax Data Transfer Format - UED (Url Encoded Data)
|
03/16/2007, By OpenJs.com
|
JSON has taken the award for the easiest method for transporting data when using Ajax. JSON is great to get data from the server side to the client side. What what about when you need to send data to the server side? Sure you can use JSON then - but the advantage of using JSON is lost.
So I propose using another format for it - UED or URL Encoded Data. Its a very simple concept - and it has been in use for a long time - all I have done is create a function that will encode the data into this format. The basic concept behind this is that the most used data structures can be easily encoded into a URL.
You can create variables, numerical arrays, associative arrays, multi-level arrays etc. using existing syntax. The best part is all the server side languages are capable of handling this format - so no parsing is needed.
ued_encode() will take an array as its argument and return the data encoded in UED format - as a string. You can use that string to send the data via POST or GET in the query part of the URL.
See ued_encode() in action.
Read Full Article
|
Rate this Ajax Articles
Rating: 8.9 out of 8 votes cast
| |
|
|
|
|
|
|
|
|
|
|
|
|