background preloader

Ajax

Facebook Twitter

50 Excellent AJAX Tutorials. Advertisement AJAX provides Web developers with plenty of opportunities to enhance the user experience and improve the performance of their websites. There are countless ways that AJAX can be used, and fortunately there are plenty of good and useful AJAX tutorials out there to help you with your own implementation. This post serves as a collection of useful tutorials on working with AJAX in a wide variety of ways. You’ll find tutorials on working with forms, building shopping carts, creating chat features, working with log-ins and usernames and much more. For more on AJAX see: Useful AJAX Tutorials Build an AJAX-Powered Shopping Cart NETTUTS shows us how to build an AJAX-powered shopping cart using PHP, jQuery and some plug-ins.

AJAX Username Availability Checker Using MooTools 1.2 When allowing a user to register a username, you can use AJAX with MooTools to let them check the availability of the username being submitted. (al) It's done. Msteigerwalt. Last Modified: April 30, 2009 RabidRatings is a simple but eye-caching ratings system which allows users to your website to rate virtually anything. Installation is easy—simply tell the PHP script how to connect to your database and include the PHP tag where you want to have a ratable item, and everything else is done for you.

Best of all: it’s free. Install it today and make your boss think you’re brilliant. Demo Notice: The IFrame above is for demo display only. Download Files What’s So Special? Most AJAX ratings widgets use star and half-star images with mouse over events on each star. Dependencies PHP4 or above, MooTools 1.2.2. License Copyright (c) 2007, 2008 Michelle Steigerwalt Credits The hearts are from the Sweetie icon pack This plugin utilizes and comes packaged with the MooTools JavaScript framework.

Everything else created by Michelle Steigerwalt Installation Upload Files to Your Web Directory Usage <? Options. JavaScript: Loop through all elements in a form. Since I've been doing alot of JavaScript programming lately, I figured I could start blogging some code snippets. Here is a JavaScript snippet that shows how to loop through all the elements in a form and retrieve their element type, name and values.

I had to use this code to gather all form values so I could post them to the server using AJAX. I revisited this code and tested it again to make sure it still works. I found that it works with the latest browser versions available today, in addition to older browsers, such as: Sending multiple post variables via ajax problems. Using POST method in XMLHTTPRequest(Ajax) Usually only the GET method is used while creating Ajax apps. But there are several occasions when POST is necessary when creating a ajax request. This could be for several reasons. For example, POST request are considered more secure than GET request as creating a POST request is relatively harder than creating a GET request.

Requirements Create a XMLHTTPRequest Object that uses the POST method.See if the arguments passed to it appear in the '$_POST' array in PHP. Code XMLHTTPRequest Object For the sake of simplicity, we are going to create the XMLHTTPRequest object using the Firefox supported ' XMLHttpRequest()' function. Var http = new XMLHttpRequest(); Using GET method Now we open a connection using the GET method. var url = "get_data.php"; var params = "lorem=ipsum&name=binny"; http.open("GET", url+"? " I really hope that this much is clear for you - I am assuming that you know a bit of Ajax coding. POST method http.open("GET",url+"?

" http.open("POST", url, true); http.send(params); That's it. Performing POST requests using Ajax. Performing POST requests using Ajax Using Ajax to send "POST" requests is very similar to that for "GET" requests, with a couple of differences. Traditionally "POST" is used when the information you're sending exceeds a certain size First, I'm bringing back our generic function for creating an Ajax object instance: function ajaxRequest(){ var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) for (var i=0; i<activexmodes.length; i++){ try{ return new ActiveXObject(activexmodes[i]) } catch(e){ //suppress error } } } else if (window.XMLHttpRequest) // if Mozilla, Safari etc return new XMLHttpRequest() else return false } //Sample call: //var myajaxrequest=new ajaxRequest() No changes have been made to this function.

Ajax POST request An Ajax POST request has the following pattern (the order is important): Performing GET and POST requests using Ajax. Performing GET and POST requests using Ajax Last updated: Sept 19th, 2009 Ajax, the catchy buzz word that ushered in the Web 2.0 era, basically describes two things once you strip away all the fluff: performing "GET" and "POST" requests asynchronously. Instead of using a FORM and requiring the user to explicitly submit it to transmit information back to the server, Ajax lets you perform such requests seamlessly at any time, using data that don't necessarily come from form elements, then get the result back without refreshing the page.

Ok, that's a mouthful, but again, it all boils down to just two things- performing "GET" and "POST" requests and doing so asynchronously. A typical GET request A "GET" request refers to sending information to the server using parameters tacked on to the current page's URL This can be done by directly adding additional info to the page's URL: or using a FORM with its method set to "GET": A generic Ajax request object <? Use PHP & AJAX to CRUD from a mysql database table (create / read / update / delete)

You are allowed to use this product or part(s) of it on a single web site only, belonging to either you or your client. You have to purchase the same product again if you want to use the same product in connection with another or other projects. Any analysis of the program, embedded data or license files by any means and by any entity whether human or otherwise and including but without limitation to discover details of internal operation, to reverse engineer, to de-compile object code, or to modify for the purposes of modifying behavior is forbidden.

Any analysis of encoded files by any means and by any entity whether human or otherwise and including but without limitation to discover details of file format or modification for the purposes of modifying behavior or scope of their usage is forbidden. All imagery and fonts used in this product are an integral part of the product. You can use images and fonts only as a part of the web site you build using this product. PHP Example AJAX and MySQL.