Donate

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!

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.