How to speed up dom insertion when used with data()
Suppose I want to populate a drop down ajaxly. The population is written like:
- var $select = $("#target");
- $.each(datas, function(){
- $("<option/>")
- .val(thia.value).html(this.name)
- .appendTo($select)
- .data('srcData', this);
- });
But the speed is considerably slow when the datas is large. I know that I can use just string concatenation and html() finally to speed it up but what can I do with the data()?