JS works when literal used as parm, but not variable

JS works when literal used as parm, but not variable

Hello,

Im using an autosuggest js that my company was already using.

When I use a literal in the parm it works, but not a variable.

For example:

var thissugg = new AutoSuggest("THISID", autosugg); // works

var $thisid = $(this).attr("id");
var thissugg = new AutoSuggest($thisid, autosugg);  // does not, but will contain the same value.

Wazup ?