[JavaScript] Prüfen, ob akt. URL localhost entspricht

if (window.location.hostname === 'localhost')
{
    // Ok
}