Wednesday, March 1, 2017

window.location.href not opening website

Hello,
The code below does not open the link, instead opens a blank page or IIS error. This issue occurs in all major browsers.
window.location.href  = 'www.nba.com';
In order to fix the issue,you must prepend the correct protocol before the website such as (http:// or https:// or ftp://). If the protocol is omitted, the link is interpreted as a file in the website.
window.location.href ='http://www.nba.com'; 

Cheers!

0 comments:

Post a Comment