Hello Everyone,

I would like to ask about AJAX. I am a new web developer with quite good knowledge of html, ASP and basic of ASP.NET. But i don't have any knowledge about ajax .i saw many ajax driven websites

Can i please know what would be a normal word or an example of AJAX.

Is ajax a special coding or we can code it together with other programming languages like c# or VB in ASP.NET.

thanks a lot

Recommended Answers

All 3 Replies

Ajax is a way of using existing technologies. Asynchronous JavaScript and XML. It is based of HTTP request and javascript as the name suggests. The tutorial at http://www.w3schools.com/ajax/default.asp should get you on your way.

Headfirst: Ajax book is excellent to start of with as well.

At its core, AJAX is just making a part of the page do something else while not refreshing the entire page. So for example, you can press a button, and just the button alone would load data from the server and display it on another part of the page (maybe right above it) while not loading the entire page. This is benefit one. It uses the JavaScript XmlHttpRequest (XHR) object .

Benefit two, is that with that XHR object, you can make HTTP requests that traditional HTML pages cannot. An HTML page can make a GET or POST request (e.g. via a form). With an XHR object, you have all HTTP request methods available.

When AJAX first came out, it used just XML - the server side script (e.g. ASP page) would generate XML data and the XHR object would retrieve it. Now, you can use JSON (a native JavaScript data structure) or any form of data structure you want. So the "X" in AJAX really is any type of data structure you want to pass the data from the ASP page to the XHR object.

Here's a snippet of code if you're curious (from my site): http://www.shinylight.com/category/languages/javascript/

Some JavaScript frameworks make AJAX extremely easy to use. jQuery can make a GET request using one line of code (compared to the many in the example code from my site). Also, jQuery is part of the .NET framework (last I heard MS announcing it) and should be integrated into Visual Studio.NET.

The Head First book (http://www.amazon.com/Head-First-Ajax-Rebecca-Riordan/dp/0596515782/ref=ntt_at_ep_dpi_1), as skfroi recommended, is a great book. I really understood the concepts reading through it. It's a bit on the thick side, but it's a quick read.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.