This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Jquery-Ajax:- How to pass nested parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Jquery-Ajax:- How to pass nested parameters" Watch "Jquery-Ajax:- How to pass nested parameters" New topic
Author

Jquery-Ajax:- How to pass nested parameters

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
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 ?



All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Sorry, but I'm not really sure what you are asking.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
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

Joined: Jan 10, 2002
Posts: 60077
    
  65

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

Joined: Feb 10, 2001
Posts: 613
my bad tats was dum question sorry for the confusion, yes $.extend was the option.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Why was it a dumb question? I think not.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
with so much time spent on jq i should have figured it out .

neways..

-P
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jquery-Ajax:- How to pass nested parameters
 
Similar Threads
Help with sorting
sendRedirect() in Tomcat?
Passing array of checkboxes from one JSP to another
JasperReport : Dynamic SQL Query to inside <queryString> Tag of jrxml file