Jose De Gouveia
Jose De Gouveia

Reputation: 1032

Open url in new tab using javascript without click an anchor

i read a lot of solutions but all of them are clicking a url, and it works, but my client ask me to do is users opens his website, it automatically open a new tab with some special offers , so my question, is there any way to open a new tab without any user intervention? , maybe a jquery plugin?, i know the tabs rely on the web browser, but it have to be a way, a lot of web pages does it,but how?

Greetings

Upvotes: 0

Views: 2006

Answers (2)

st mnmn
st mnmn

Reputation: 3669

Write script in your page to open new page:

    <script>
      window.open("specialOffers.aspx");
    </script>

and in the "specialOffers.aspx" page in the tag write:

    <base target="_blank"/>

Upvotes: 0

otakustay
otakustay

Reputation: 12395

Without modifying the configuration of browser, the answer is no, only trusted event can open a new window (or tab)

You may ask if your client could change their browser's configuration to allow a popup window from an untrusted javascript program.

Upvotes: 1

Related Questions