1

UPDATE:

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

4
  • Array in jQuery are the same as Javascript array..what's the difficult part you don't understand ? Have you read the official doc ? Commented Apr 20, 2011 at 10:06
  • You want to send a javascript array to the server using ajax? Where does the array come from? Commented Apr 20, 2011 at 10:06
  • Please clarify and improve your question to receive a good answer. Commented Apr 20, 2011 at 10:16
  • jQuery is a Javascript library. Arrays are a language feature of Javascript (well, kind of). Commented Apr 20, 2011 at 10:18

2 Answers 2

1

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?

Sign up to request clarification or add additional context in comments.

Comments

0

What about push

var array = new Array();

array.push(value);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.