I want to have a check in my javascript if the page loading up is on my local machine.
The reason why I want to do that is that when I developing I like to make sure
You could detect in one of your code behind pages with c#, like this:
if ((Request.Url.Host.ToLower() == "localhost"))
{
// ..., maybe set an asp:Literal value that's in the js
}
Or if you want to do it from client script, you could check the value of window.location.host.
if (window.location.host == "localhost")
{
// Do whatever
}
Hope this helps.