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

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -