Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
IP Address ~ what html script can I include in my blog so the visitor can see their own IP Address?
I do not want to reference back to another web site.
Imadoofu - I could not get that to work - the exact html would be great.
Dave I tried
Your IP Address is
<script type="text/javascript">
var ip = '<!-- #echo var="REMOTE_ADDR" -->';
</script>
and it did not work - it looked blank.
3 Answers
- ♫DaveC♪♫Lv 71 decade agoFavorite Answer
The above answer is only partially correct. This part:
<!-- #echo var="REMOTE_ADDR" -->
is called SSI (Server-Side Includes), requires no JavaScript, and has to be interpretted by the web server. Normally, SSI is not interpretted unless the document extension is .shtm or .shtml so, therefore, you will have to experiment to see what you'll get.
If you get the SSI to work then, as demonstrated, you can capture the SSI output and place it into a JavaScript variable:
<script type="text/javascript">
var ip = '<!-- #echo var="REMOTE_ADDR" -->';
</script>
However, this still may not work for your visitor if they happen to have JavaScript disabled in their browser.
- Anonymous1 decade ago
I found this at
http://javascript.internet.com/user-details/ip-add...
its javascript so you would just put it in <script> and </script> and then change whatever you want to say it in there
var ip = '<!--#echo var="REMOTE_ADDR"-->';
don't know exactly how it works but I think that will give you a variable ip that is a string of the ip so you might be able to go
<p onload="var ip = '<!--#echo var=/"REMOTE_ADDR/"-->';document.write(ip);">
</p>
but I dunno if that will work.
- ?Lv 45 years ago
mutually as i think of that's achieveable to get a area from an IP handle, a random man or woman ought to probable purely hint the IP to the corporation which could provide you internet, yet i do no longer think of it is going greater effective than that. you are able to probable purely get a precise area from the corporation in case you have some severe count, like attempting to get information some legal or great crime.