jquery - Continuing functions for chrome extensions-javascript -


so working on small chrome extension. there webpage , want click buttons on webpage. after click of them want click next page button , keep doing same thing.

i have no problem finding buttons or nextpagebutton. able using setinterval functions feel kind of hacky way this.

the below code have far

function clickbuttons(){      var followbuttons = $('.buttonclass');     var numberofbuttons = followbuttons.length;      for(var i=0; i<numberofbuttons; i++){         followbuttons[i].click();     }     settimeout(nextpage, 500); }  function nextpage(){      var nextpagebtn = $('.nextpagebuttonclass');     nextpagebtn.click();          settimeout(clickbuttons,500); } 

so question 1. loop click buttons not working. there better way click every button class? 2. need call second function after first one. , when second 1 finished, need call first 1 again , must follow each other constantly. tried setting timeout , calling other 1 ın both functions. not working. how can this?

this code doesn't anything. , have been scratching head. sorry huge javascript noob


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -