Sep
03
Do you need to install anything else if you want to design a website using AJEX?
Byanyone tell me if you want to develop a website using AJAX do u need to install anything else other then php, mysql, and apache server?
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
3 Comments
September 3rd, 2010 at 10:38 pm
Make sure first you have a back-end, a php or asp or .net script to answer your AJAX’s call. Ajax calls your script via a URL (much like a human user would), with parameters included (http://www.mydomain.com/somefolder/myscript.php?pet=cat&fruit=banana).
I highly recommend using a Javascript library, and using their system for AJAX. The most popular are Jquery and MooTools.
To use jquery, first you download it from http://www.jquery.com, then, as they indicate in their getting started example, enter this HTML in the <head> area…
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
// Some Javascript
});
</script>
</head>
Then, for the Ajax call, you’d use something like..
<script>
$.ajax({
type: "GET",
url: "www.mydomain.com/somefolder/myscript.php",
data: "pet=cat&fruit=banana",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
</script>
Benefit is you have to use nice, structured code, you have lots of other options, and best of all, you can easily add other javascript features.
September 3rd, 2010 at 10:38 pm
You should be good to go with just that, you will need HTML, PHP (or ASP if you want to use that instead), MySql, Javascript, and XML knowledge though.
September 3rd, 2010 at 10:38 pm
yes u need to install them first b4 ajax