Jump to content
xisto Community
Sign in to follow this  
TheDarkHacker

Ajax Prototype good thing

Recommended Posts

AJAX prototype is very good library and a simple way to replace forms.Instead of webpage submitting and refresh with ajax you can get lots of results without reloading page.Every form can be replaced with this,just with few lines.AJAX Prototype can be found on this webpage: http://prototypejs.org/ and there examples and help,downloading link and lots of information.AJAX can send and request data from server scripting technologies like PHP or ASP.This example shows simple prototype syntax:

function send(){new Ajax.Request("people.php",										{										method: 'post',										postBody: 'name='+ $F('name'),										onComplete: what										});								}						function what(req){							   alert("Alert your last name is:"+req.responseText);						}
This code first sends the name to people.php,and then it searches for output from people.php,and it alerts it.When you download the library you only need to specify the source of library in every page you have,and you just need to write your ajax code.There are few options in prototype,not only for request,like $F[] which is requesting value from id.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.