1

In my app (with alpinejs 3 ) I have texarea with several urls entered(any url on any new line) and I try to open any url in new tab of my browser:

 let arr = content_textarea.split( String.fromCharCode(10) ); let l= arr.length // let windowFeatures = "left=100,top=100,width=320,height=320"; for (let i= 0; i< l; i++) { console.log('arr[i]::') console.log(arr[i]) // window.open(arr[i], '_blank', windowFeatures ); // Uncommenting this line did not window.open(arr[i], '_blank' ); // delay(1000); // Uncommenting this line did not console.log('NEXT::') } 

But only 1st link is opened actually. In browsers console I see output of all lines. If there is a way to OPEN ANY url in separate browsers tab ?

I tried Google Chrome Version 100.0.4896.75 under kubuntu 20.

1

1 Answer 1

1

Try this:

let arr = content_textarea.split( String.fromCharCode(10) ); let l= arr.length for (let i= 0; i< l; i++) { window.open(arr[i], i); } 
Sign up to request clarification or add additional context in comments.

1 Comment

No that does not work for me. Only 1st url is opened

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.