javascript - How to emulate at once 10 successive clicks from console using JS for infinite scroll -


to fetch more data on loaded page (infinite scrolling), have click on more.


from browser console, can simulate such user action running:

eventfire(document.queryselector('.more'),'click'); 

using following snippet found somewhere here on s.o.:

function eventfire(el, etype){   if (el.fireevent) {     (el.fireevent('on' + etype));   } else {     var evobj = document.createevent('events');     evobj.initevent(etype, true, false);     el.dispatchevent(evobj);   } } 

question

i need find pure javascript (no library) way able run only once console snippet emulating 10 successive clicks on more.


what i've tried far

for (var = 0; < 20; i++) {   eventfire(document.queryselector('.more'),'click'); } 

it loads 1 batch of records corresponding 1 click , basta.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -