Skip to content Skip to sidebar Skip to footer

Javascript: Open Url In Current Tab

I feel a little bit like a noob, but : How can I open a link in the current tab? I don't want to use open(link); .

Solution 1:

You can open a link in the same tab using:

window.location = "http://google.com";

Solution 2:

With html you can do:

<ahref="index.html"target="self">Link</a>

Post a Comment for "Javascript: Open Url In Current Tab"