is it possible to use HTML5 input type date for a Ruby and Rails 3.2.12 form?
When its possible how can I use it?
Thanks
Your server-side solution has nothing to do with your client-side solution. If tomorrow browsers support a new input type called Ray, then it doesn't matter whether or not Ruby supports it. Your form will send the data as an HTTP POST which Ruby, and any other decent server side app, can process.
Ajax froms are increasing becoming the industry standard. More and more frameworks like handling it natively, for example scala lift or grails.
Is there any ajax automation library in django that can generate ajax froms like this:
http://simply.liftweb.net/index-4.8.html ?
I don't really know what is the "AJAX form" you are referring to as the forms are simply static HTML elements. My guess is you might be thinking of ajax form validation.
In this case the static HTML code generated by Django forms is sufficient. All you have to do, is to write some JavaScript (I'd use jQuery) and handle it a bit differently server side.
please hava a look at
http://alexkehayias.tumblr.com/post/14020155360/django-form-validation-ajax
and the app for it
http://pypi.python.org/pypi/django-ajax-forms/
Is anything that uses JavaScript and asynchronous communication of XML data considered Ajax?
Most people who deal with AJAX would consider any usage of XMLHttpRequest to be AJAX.
This doesn't mean that the request need be async either.
These days, JSON replaces XML for communications.
From wikipedia:
With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not needed (JSON is often used instead), and the requests need not be asynchronous.
AJAX seems to encompass any application which retrieves data using the XMLHttpRequest object. Despite it's name you don't need to use XML and I'd wager most AJAX apps these days are using JSON instead. Also they don't necessarily make asynchronous requests. We probably need a new buzzword at this point. Maybe websockets will take off!
The term AJAX and its abbreviation is a misnomer. It has nothing to do with XML. It typically refers to the XMLHttpRequest function. The name of this function again is a misnomer because you could use it to get or send JSON data, plain text, or even binary data now.
AsyncHttpRequest would have been a more appropriate term for the function, and AJAH (Asynchronous JavaScript and HTML) instead of AJAX. On a side note, although XMLHttpRequest allows synchronous requests too, they'd probably be better off getting rid of it altogether.
Typically AJAX applications make good use of asynchronous calls and avoid page refreshes as much as possible. Gmail is a good example. Facebook, on a modern browser, also uses AJAX. Clicking on different links like "News Feed", "Events", etc. doesn't cause a page reload although the path in the address bar changes. Github does the same on modern browsers.
I have never used Ajax with JSON. Are there any good resources to look upon?
Think of Ajax as a way to send and receive textual content with the server. The format of the messages you send back and forth is up to you. You could use JSON, XML, YAML, CSV, or whatever else you want.
If you separate these two concerns your problem should be a lot easier to approach.
Figure out how to make an Ajax call to your server
Figure out how to parse and serialize JSON
If you use a JavaScript framework, like jQuery or Prototype, both of these things will be handled for you pretty seamlessly with their Ajax APIs.
http://api.jquery.com/jQuery.ajax/
http://www.prototypejs.org/api/ajax/request
I'm not so familiar with Ajax but I keep hearing Json mentioned as some kind of competing option. Is there a rule for when to use one versus the other?
I'd like to process Javascript events in my app and update the front-end dynamically from the app but I'm not sure whether I need to use Ajax or Json for this.
Ajax and JSON are very different things.
From Ajax (programming):
Ajax, sometimes written as AJAX
(shorthand for asynchronous JavaScript
and XML), is a group of interrelated
web development techniques used on the
client-side to create interactive web
applications or rich Internet
applications. With Ajax, web
applications can retrieve data from
the server asynchronously in the
background without interfering with
the display and behavior of the
existing page. The use of Ajax has led
to an increase in interactive
animation on web pages and
better quality of Web services thanks
to the asynchronous mode. Data is
retrieved using the XMLHttpRequest
object. Despite the name, the use of
JavaScript and XML is not actually
required, nor do the requests need to
be asynchronous.
From Introducing JSON:
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
Here's some JSON:
{ "taco" : "awesome", "burrito": "less awesome", "fishTaco": "1000" }
Looks pretty much like an array in this case.
And you can use AJAX to get the JSON. I use it to return table data often. You've probably already used JSON-like data in your javascript but didn't realize it.
I prefer to request JSON data rather than XML or HTML. I find it easier to deal with than XML, and more flexible than HTML.
JSON is not a competing technology to AJAX it's just a data format.
Where you might hear competition is between XML and JSON, JSON having the advantage of being typically lighter and in native javascript already, XML having the advantage of portability and toolsets.
Introducing JSON
As some have stated, these are two different things entirely. AJAX is a method of using JavaScript to initiate HTTP requests to fetch data. That data can be in any sort of format, but most commonly XML, HTML, and yes, JSON.
So, as already mentioned, JSON is a data format much like XML or CSV, just with a different set of formatting rules.
Json is nothing more (and nothing less) than a format of the data you transfer with the Ajax-way of talking to the server.
Some transfer the data in the form of xml, other just plain text, others use Json.
More info about JSON on Wikipedia: http://en.wikipedia.org/wiki/Json
Ajax and JSON aren't the same thing. Ajax is a technique combining, among other things, lightweight asynchronous requests and typically some DOM manipulation, in order to create richer user interfaces in web applications.
The "X" in Ajax is often taken to mean "XML", and many sites using Ajax use XML as the format of the data returned by the server in response to such requests.
JSON (http://json.org) is a lightweight data interchange format based on Javascript's object notation. As such, it's easy to parse in Javascript. It's also a lot less verbose and repetitive than XML.
I think you may be talking about AJAX vs JSONP
http://en.wikipedia.org/wiki/Json#JSONP
If that's the case, the one benefit of using JSONP, is that you can get around the cross-site sandboxing (although, possibly introducing new security risks)
AJAX is used for get data from server, whereas JSON is just a data format which can used to send data to the server.
I thought I would provide this comparison from my class lecture
AJAX (Asynchronous JavaScript + XML) incorporates several technologies:
Standards-based presentation using XHTML and CSS;
Dynamic display and interaction using the Document Object Model (DOM);
Data interchange and manipulation using XML and XSLT;
Asynchronous data retrieval using XMLHttpRequest;
JavaScript binding everything together.
JSON, short for JavaScript Object Notation is a lightweight data interchange format. Its main application is in AJAX web application programming, where it serves as an alternative to the use of the XML format for data exchange between client and server.
The above answers are correct, but If you are new to using web technologies, all you need to know is simply
that Ajax is a subset of JavaScript.
It is a technology, a means for you to send only portion of the web page data back to the server to get processed
and get the response back while the user is interacting with other parts of the page. This way, the
Interaction with the page is consistent and seemless from the user stand point. Now, JSON on the other hand is
the how you can format the data (similar to XML) that you are sending back to the server, and getting back.
and it's used primarily with Ajax. It was developed and used mainly
because it is lightweight and human readable, which makes it more efficient and user friendly.
Hope that helps a bit.