Skip to main content

Posts

Showing posts with the label JavaScript call function inside of itself

Run URL one by one in for loop JavaScript

Hello Guys, I’m sharing here “ How to Run URL one by one in for loop in JavaScript? ” Following the bellow example for the same:- //URL Array var linksArray = [ 'https://www.codefari.com/' , 'https://www.code-sample.xyz' , 'https://www.code-sample.com' ]; //Execute runURL method function runURL() {     if (linksArray.length == 0) return ;     var url = linksArray.shift();     var openWindow = window.open(url);     setTimeout( function () {         openWindow.close();         //Execute runURL method         runURL();     }, 5000); } //Execute runURL method runURL();