Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:10:55+00:00 2026-06-15T20:10:55+00:00

I’d like to get the security zone (Internet zone / local intranet) for a

  • 0

I’d like to get the security zone (Internet zone / local intranet) for a number of URL’s which are in the same domain. I thought the best solution would be to get this through iFrame.
@Teemu. Code works now. Thank you very much. But one problem so far: It displays the wrong text. Although the page is in trusted zone (local intranet) he displays “untrusted” (Internet zone). Any idea why?

<html>
<head>
<script type="text/javascript">


function getZone() {
    var text = new Array();
    document.getElementsByClass('iframeNames');

var test;
for (var i = 0; i < document.frames.length; i++) {
try {
    test = document.frame[i].contentWindow.document;
    text[i] = "Trusted (Local Intranet)";
} catch (e) {
    text[i] =  "Untrusted (Internet Zone)";
}
} //end-for

    var showText = getElementsByClass("zone");
    for (var i = 0; i < showText.length; i++) {
        setText(showText[i], text[i]);
    };
} //end getZone()

function setText(showText, text) {
    showText.innerHTML = text;
} //end setText

if (document.getElementsByClassName) {
    getElementsByClass = function (classList, node) {
        return (node || document).getElementsByClassName(classList);
    };
}

</script>
</head>

<style type="text/css">
tr:nth-child(2n) {
    background-color: #ddd;
}
.format {
    background-color: #ffff;}

#formatierung {
margin-left: 10px;
margin-top: 30px;
font-family: Arial;
font-size: 13px;

}

</style>

<body>

<iframe src = "http://example.com" class = "iframeNames" width = "0" 
height ="0"></iframe>
<iframe src = "http://example.com/index/" class = "iframeNames" width = "0" 
height =  "0"></iframe>

<script type = "text/javascript">
window.onload = function() {

getZone();

};
</script>


<div id = "formatierung">

<table width = "100%">


<tr class = "format"><td><h2>System</h2></td><td><h2>Check Security-Zone</h2></td></tr>
<tr><td>example1</td><td class = "zone"></td></tr>
<tr><td>example2</td><td class = "zone"></td></tr>

</table>
</div>


</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:10:57+00:00Added an answer on June 15, 2026 at 8:10 pm

    You can try this:

    var test;
    for (var i = 0; i < document.frames.length; i++) {
        try {
            test = document.frames[i].document;
            text[i] = "Trusted (Local Intranet)";
        } catch (e) {
            text[i] =  "Untrusted (Internet Zone)";
        }
    }
    

    With this code you won’t need isTrustedIE() at all.

    Like I said in my previous comment, frames[] is a collection of the “window” objects in the document. This code just checks, if it can get a reference to the document in the iframe. It’s not possible, when iframe‘s content is loaded from cross-origin source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run a str_replace or preg_replace which looks for certain words
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I have an autohotkey script which looks up a word in a bilingual dictionary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.