SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Oct 2002
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting IP address using JavaScript only

    Hi,

    Is it possible to retrieve the viewers IP address using JavaScript only? The servers I am running on don't allow for SSI.

    Thanks

    K
    Eternity

  2. #2
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No. That would be an extreme security issue.

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, because javascript runs on the client's computer and has no idea on it's IP address. What if you save the page on your hard disc and open it offline?

    Majan Could you elaborate how can this be a "security issue"?

  4. #4
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kjc
    Hi,

    Is it possible to retrieve the viewers IP address using JavaScript only? The servers I am running on don't allow for SSI.

    Thanks

    K
    You can but with java's applet and I think on Netscape you would have no restriction but on IE this can be prevented by security option.

  5. #5
    SitePoint Enthusiast Gridlight's Avatar
    Join Date
    Apr 2005
    Location
    Oxford, UK
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can but with java's applet and I think on Netscape you would have no restriction but on IE this can be prevented by security option.
    Err, no. Javascript != Java..
    Cheers,
    Gridlight

    BrowserCam for 30?! I'm in, are you?

  6. #6
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Come to think of it, I'm not sure why I said that. I remember thinking up some scenario in which the ip address could be exploited, but I can't remember it and it's probably bogus


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •