javascript window open in current tab code example Example: javascript open url window.location.href = "http://example.com/";