Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Check whether internet / intranet ....  and other questions..

Posted on 2004-09-02
6
Medium Priority
?
393 Views
Last Modified: 2008-03-17
Hi Experts,
Could you please help me in the following :

I'm trying to make sure that my web-based product works without any problems in Windows XP SP2.

Since the security settings in the intranet zone and internet zone are different, I would like to put a check in my product to find out if the URL is accessed within intranet or internet.  How do I do this through client-side scripting ?

Also,
1. how do I check the security level (medium / medium-low) ?

2. how do I check if popups are blocked ?

3. how do I check if there are any window-restrictions (status bar, scroll bar - on or off) ?

Thanks,
Benny
0
Comment
Question by:bennyv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 4

Assisted Solution

by:sgalzin
sgalzin earned 120 total points
ID: 11972348
hi,

sometimes intranets have a different url. the reason for that is, on the intranet, you can access the server by its internal name or alias directly. so one possiblity would be to check if the url has the actual internet domain name or not. depending on the answer, your either dealing with a client from the internet or the intranet (respectively).

the code for that in JavaScript would look like this :

var onTheInternet = ( new String ( window.location ) ) .toLowerCase () .indexOf ( 'http://www.mydomainname.com' ) != -1;

hope that helps,

stephane.
0
 

Author Comment

by:bennyv
ID: 11972512
Hi sgalzin,

Thanks for your reply.

Do you mean to give the domain name as a hard coded string (like 'http://www.mydomainname.com' ) in the script ?  I think we cannot do that.   I'm working on a product which can be used by any customer and their website names or domain names will be different.  

What about the other questions ?  Any clue ?

Thanks,
benny
0
 
LVL 3

Accepted Solution

by:
andYetAnotherLoginName earned 255 total points
ID: 11973413
For intranet ranges, consult http://www.faqs.org/rfcs/rfc1918.html section "3. Private Address Space". Yet, there's no cross-platform-safe way to find out IP from JavaScript, so that must be done with server-side. IP check then can be performed on client-side, with JavaScript.
0
 
LVL 3

Assisted Solution

by:andYetAnotherLoginName
andYetAnotherLoginName earned 255 total points
ID: 11973473
oh, there's more...

2. how do I check if popups are blocked ?
 open one :) if you don't receive valid window handle, than you have them blocked.

3. how do I check if there are any window-restrictions (status bar, scroll bar - on or off) ?
 I doubt that's possible...
0
 

Author Comment

by:bennyv
ID: 12306327
Hi,

Could you please split the points to "andYetAnotherLoginName" and "sgalzin" (65 to "andYetAnotherLoginName" and 60 to "sgalzin") and accept both the answers.

Thanks,
Benny
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question