Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

jquery function params

Posted on 2009-07-13
2
Medium Priority
?
448 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 900 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

610 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