MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

what is the best way to post array in ajax?

0
Started on: 23 January 13
Participants: 1
I have an java script array created as
var ar = new Array();
ar[0] = 'foo';
ar[1] = 'bar';
I need to know what is best way to post it to server using ajax (jquery) .

Thanks in advance

I have an java script array created as

var ar = new Array();ar[0] = 'foo';

ar[1] = 'bar';

I need to know what is best way to post it to server using ajax (jquery) .

Thanks in advance

This challenge is listed under Development & Implementations Community

Initiator

Pawan Pandey
Pawan Pandey
  Follow

Give me a computer and leave me alone ... I will be happiest person in this world :)

Please to reply this post
Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.

1 Suggestion

  1. 04 March 13
    0

    Hi please try to use the below way

    use type: "POST" in ajax call

    var ar = new Array(); ar[0] = 'foo'; ar[1] = 'bar'; $.ajax({ url: url_to_post, type: "POST", dataType: 'json', data: {'ar': ar}, complete: function(data){ } else { } } });

Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top