2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-12-23 03:18:55 +00:00

Remove innerHTML usage. Fixes #93.

This commit is contained in:
Tomas Kirda 2013-08-31 16:21:16 -05:00
parent 1906d93ff9
commit d1ee9c0cf2

View File

@ -29,10 +29,12 @@
escapeRegExChars: function (value) {
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
},
createNode: function (html) {
createNode: function (containerClass) {
var div = document.createElement('div');
div.innerHTML = html;
return div.firstChild;
div.className = containerClass;
div.style.position = 'absolute';
div.style.display = 'none';
return div;
}
};
}()),
@ -139,7 +141,7 @@
}
};
that.suggestionsContainer = Autocomplete.utils.createNode('<div class="' + options.containerClass + '" style="position: absolute; display: none;"></div>');
that.suggestionsContainer = Autocomplete.utils.createNode(options.containerClass);
container = $(that.suggestionsContainer);