Solved

jquery function params

Posted on 2009-07-13
2
442 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

831 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