Solved

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

Posted on 2004-09-02
6
387 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
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
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…

773 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