Omer Cohen
Omer Cohen

Reputation: 141

Go to page without having to open a new window jquery

$(button).click(function(){
     window.open("www.wxample.com");
});

this code open page in new window. Go to page without having to open a new window?

Upvotes: 1

Views: 39

Answers (1)

Shaunak D
Shaunak D

Reputation: 20636

You need window.location

$(button).click(function(){
     window.location.href = "www.wxample.com";
});

See This Link for more details on how location works.

Upvotes: 3

Related Questions