Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-09-02
6
Medium Priority
?
395 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
5 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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'…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

824 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