2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2025-01-11 01:32:04 +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) { escapeRegExChars: function (value) {
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}, },
createNode: function (html) { createNode: function (containerClass) {
var div = document.createElement('div'); var div = document.createElement('div');
div.innerHTML = html; div.className = containerClass;
return div.firstChild; 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); container = $(that.suggestionsContainer);