javascript - Deal with big DataList -


https://jsfiddle.net/pb47ap8t/2/

var fruits = ["test"]; (var i=0;i<500;i++){     fruits.push("test"); } // var datalist = document.getelementbyid('datalist'); var frag = document.createdocumentfragment(); (var in fruits) {        if (fruits.hasownproperty(i)) {             var option = document.createelement("option");           option.textcontent = fruits[i];           option.value = fruits[i];           frag.appendchild(option);         }    }  datalist.appendchild(frag); 

i want populate datalist (arround 500 values), how can without issues concerning massive data loading ?

apologies writing answer , not commenting don't have enough reputation. freezes because of populating drop down on clicking element when data fetched server. loading asynchronously help..


Comments

Popular posts from this blog

4x4 Matrix in Python -

python - String indices must be integers and while issue -

python - PyInstaller UAC not working in onefile mode -