Alireza
Alireza

Reputation: 5673

php + javascript open a link in new weindow (tab) automatically

I have 100 links for example, in a file. The idea is to loading to a php page, it loads the links file, it reads the first line and gets the first link. Then it opens it in a new window of browser, after 5 seconds the page refreshes itself and it gets the second link from the file and opens it in a new window again.

Now, I can do the whole thing by php, But I don't know how to open the link in a new window automatically without any click. and I guess it might be possible through JS.

Thanks for help :)

Upvotes: 0

Views: 4027

Answers (1)

Brad
Brad

Reputation: 163272

window.open('http://www.someurl.com','NameOfWindow');

There are also attributes you can keep specify to have more control. See http://www.pageresource.com/jscript/jwinopen.htm

Upvotes: 2

Related Questions