views:

576

answers:

3

Hi,

Is there a way to obtain domain name of a windows machine by using javascript in a browser (IE, FireFox, etc) ?

+2  A: 

window.location.host

EDIT: If you meant the domain of the client machine, I don't think it is possible.

Chetan Sastry
+2  A: 

If you are asking about the machine name of the host that served up the current page, you can find that with

window.location.hostname

If you are asking about the name of the machine that is displaying the page in a browser, that information is restricted by browsers for security purposes.

Mike Clark
A: 

document.domain

amjith ps