firefox-addonjquery-autocompletejquery-trigger

jquery triggering not working in firefox extension


Steps to reproduce:

i created a hai.html and using pagemod i injected scripts into that, here is the code and that hai.html https://github.com/suneeshtr/trigger-test.git

Actual results:

injection of scripts and everything works fine except triggering. when i tried to append a file it works..

here is a part of code:

alert("content");
$(document).ready(function() {
var values = [{val:'santiagotactivos', meta:'Santiago Montero'},
{val:'johnnyhalife', meta:'Johnny Halife'},
{val:'arielflesler', meta:'Ariel Flesler'},
{val:'rbajales', meta:'Raul Bajales'}];
var customItemTemplate = "<div><span />&nbsp;<small /></div>";
function elementFactory(element, e) {
var template = $(customItemTemplate).find('span')
.text('@' + e.val).end()
.find('small')
.text("(" + e.meta + ")").end();
element.append(template);
};
alert(JSON.stringify($("textarea")));
// here is how we use it
$('textarea').sew({values: values, elementFactory: elementFactory});
});

Solution

  • try this one too:

    http://www.hawkee.com/snippet/9391/

    $('#inputbox').triggeredAutocomplete({
        hidden: '#hidden_inputbox',
        source: "/search.php",
        trigger: "@" 
    });