Solved

jquery function params

Posted on 2009-07-13
2
439 Views
Last Modified: 2012-06-27
In the below code  i want to pass a parameter to a jquery function as in the usage, how can i receive it inside the extraParams options, i have tryed in different ways but no luck

thaks


// FUNCTION

$.fn.doAutoCompDesc = function(relID){ // here i ask for a parameter
 

		$(this).autocomplete('./?map=Factura_FormUtilities&level=descripcion',{

			onItemSelect:selectItem,

			onFindValue:findValue,

			formatItem:formatItem,

			extraParams: {rel:relID} // <--- how can i receive the function parameter here
 

		}

		);

	}
 

// USAGE

$(".description").doAutoCompDesc(2); // here i start using my function passing a parameter

Open in new window

0
Comment
Question by:WebserviceMX
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 300 total points
ID: 24852126
what you posted looks correct. How are you accessing/dereferencing the value in  autocomplete()?
0
 

Author Closing Comment

by:WebserviceMX
ID: 31603120
thanks just closing
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now