user478636
user478636

Reputation: 3424

Arrays in jquery-ajax

UPDATE:

Sorry I mean to say how may i use JS arrays with ajax?

Upvotes: 1

Views: 97

Answers (2)

Dave Harding
Dave Harding

Reputation: 481

Arrays in javascript are very easy to use. To set up an array, simply set up the array like this.

var myArray = new Array(); 
myArray[0]="one value";      
myArray[1]="two value";
myArray[2]="three value"; //etc

You don't need AJAX to store data from a text box, as the DOM can grab the contents of a text box without any ajax calls.

In jQuery, you can get the contents of a text box like this $("#idofyourtextbox").val();

Reference: How do I get the value of a textbox using jQuery?

Upvotes: 1

Gowri
Gowri

Reputation: 16835

What about push

var array = new Array();

array.push(value);

Upvotes: 0

Related Questions