Si la fenêtre indéfinie

if (typeof window !== 'undefined') 
Faithful Fox