Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jquery-Ajax:- How to pass nested parameters

 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

can some one tell me syntax to pass nested parameters to $.ajax ? following is my code

now question is how to i pass it to following $.ajax call ?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, but I'm not really sure what you are asking.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok one more try

I call AutoText Function with following parameters,note queryString is nested parameter.

$("#AutoComplete").AutoText("getData.jsp",{minSearhChars:3,queryString:{accountKey:1,someKey:10}});

my AutoText functions looks like this



question is how do i pass the queryString to ajax call so that values of accountKey and somekey are passed to jsp.

I can hardcode it as data:{where:value,accountKey:queryString["accountKey"]..}

but i want it in plugin so needs a dynamic solution.

-P
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not sure, but are you asking how to merge the object in options.queryString with the object {where: value} so that all three parameters are submitted to the Ajax request?

If so, investigate the $.extend() utility function.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my bad tats was dum question sorry for the confusion, yes $.extend was the option.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why was it a dumb question? I think not.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with so much time spent on jq i should have figured it out .

neways..

-P
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic