Interacting With The Server Side


In previous lesson we talk about jQuery load method and in this lesson we are going to learn about jQuery get and post methods.

Let See an Example :

Image

Here we use two ways to display the input form values. 1. In first way we find all id with content and return their values. 2. In second way we use jQuery serialize() method. This method is use for return filter data. Serialize use default name values of boxes for return values. If we input in 1 box - ankit and in second box- kalra So it return as name = ankit & content = kalra. We use here preventDefault method only for display values on console screen it's stop the form for submit and returns the values on console screen.

In our case we use Serializemethod so let continue :

In below example first we create some files for our use -
1. demosave.php
2. demoload.php
3. demodata.txt

Let see these files and their code -

Image

Now see index file(main file)

Image
View Demo

Wconcert India © 2015   ·   All Rights Reserved

Free Web Hosting