Solved

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

Posted on 2004-09-02
6
390 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 40 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 85 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 85 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

728 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