Production of a group of news ideas Analysis:
var oLi = document.getElementById (' list ');
var obtn = document.getElementById (' btn ');
var arr = [
' [Most recommended] pride-2015 read books share [up] ',
' [Most comments] Open source A Androidflyme store has been online ',
"[News headlines] This telescope has the Earth so big scientists it to see the black hole ',
' [Recommended news]ubuntu 15.04 embracing the Internet of things, supporting drones and robots '
];
/*
Avoid multiple clicks.
Ideas: 1, buttons on the body of trouble; (User experience is not good) such as disabling the Buttond property or display hidden;
2, first empty, and then generate (performance is not very good) oli.innerhtml= ';
3, judgment;
*/
var onOff = true;
Obtn.onclick = function () {
if (ONOFF) {
for (i=0;i<arr.length;i++) {
oli.innerhtml+= ' <li> ' +arr[i]+ ' </li> ';
};
OnOff = false;
};
};
JS Study Note 2015-4-25 (12th day)