Important alert: (current site time 7/15/2013 1:07:19 PM EDT)
 

VB icon

_Netscape and iMac detection snippet...Sees if user is using Netscape, their IP, and computer type_

Email
Submitted on: 12/6/2000 6:52:54 PM
By: paul_cormie 
Level: Intermediate
User Rating: By 2 Users
Compatibility: JavaScript
Views: 14428
(About the author)
 
     
If you are using an iMAC on a javascript enabled Netsape Browser you will see your IP address, along with the confirmation of using an iMAC and Netscape at the top of the Browser window in small font.
If you do not see it, that means you are using IEx.x


Enjoy!


 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: _Netscape and iMac detection snippet...Sees if user is using Netscape, their IP, and computer type_
' Description:<br><font face="Arial, Helvetica, sans-serif" size="2">If you are using an iMAC on a javascript enabled Netsape Browser you will see your IP address, along with the confirmation of using an iMAC and Netscape at the top of the Browser window in small font. <br>If you do not see it, that means you are using IEx.x <br><br><br>Enjoy!</FONT><br>
' By: paul_cormie
'
' Returns:ip address, if user is using netscape, and detects if they are using an iMAC
'
' Assumes:All of the HTML is there so its a simple cut and paste, and your off. Enjoy
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2017&lngWId=14'for details.'**************************************

<html>
<head>
<title>Netscape users?</title>
<!-- JavaScript Start -----
	
	browserName = navigator.appName
	browserVer = parseInt(navigator.appVersion)
	ipAdd = ""
	if (browserName == "Netscape" && navigator.javaEnabled()) {
		if (browserVer >= 4) {
			ipAdd = java.net.InetAddress.getLocalHost().getHostName()
		}
			else {
				ipAdd = java.net.InetAddress.getLocalHostName()
			}
	}
	if (ipAdd != "") {
		document.writeln("<font face="Arial, Helvetica, sans-serif" size="1"><SMALL>Your Internet Protocol Address is "+ ipAdd + " and you are using Netscape Navigator OS</SMALL>")
			if (ipAdd.substring(0,7) == "17.254.") {
				document.write("<font face="Arial, Helvetica, sans-serif" size="1"><SMALL>on an iMAC computer</SMALL>")
	}
			}
			
--- JavaScript End ----->
<Body>
<br><br><br><font face="Arial, Helvetica, sans-serif" size="2">If you are using an iMAC on a javascript enabled Netsape Browser you will see your IP address, along with the confirmation of using an iMAC and Netscape at the top of the Browser window in small font. <br>If you do not see it, that means you are using IEx.x <br><br><br>Enjoy!</FONT>
</body>
</html>


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/18/2003 3:26:32 AM

why is it so hard to format your code a proper way?
Your format is TERRIBLE!
i fyou don't know how to format code, look at this article: http://www.cs.umbc.edu/courses/undergraduate/CMSC202/fall03/Projects/codingstd.shtml
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.