tlotr wrote:
Can I get my local IP address from javascript under IE? I've some pieces of
code that work under netscape, but it doesnt under ie.
Thanks in advance,
tlotr
It depends, if the document is loading off an HTTP server, then no, you can't
obtain your IP address without lowering your security settings to dangerously
low levels (or putting the site in your Trusted Zone).
If the file is being loaded from a local drive, or you've lowered your security
settings, or you've put a site in the Trusted Zone, it shouldn't be too hard to
cobble something together with a WShell.Scripting object and ipconfig.exe.
There may be an easier way to do it as well, I haven't given it much thought.
It would be something like:
<script type="text/javascript">
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("ipconfig.exe > c:\\ipconfig.txt", 2, true);
</script>
But that doesn't actually work, so you'd most likely have to create a .CMD file
on the drive with the command you want, then WshShell.Run() that, or possibly
there is a Registry key you could read to obtain that information.
Again though, none of this is going to work on any copy of IE except yours,
assuming you've lowered the security enough to let it run, and agree to let it
run when it prompts you.
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html