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. I know that the statement value[i] = frames[i].isTrustedIE(); is not possible! So could you give me the missing puzzle to get working this?. Thank you very much
. Here is the following code!
Code:<html> <head> <script type="text/javascript"> function isTrustedIE(){ try{ new ActiveXObject("Scripting.FileSystemObject"); } catch(e){ return false; //untrusted } return true; //trusted } function getZone() { var value = new Array(); var text = new Array(); var frameNames = document.getElementsByClass('iframeNames'); for(var i = 0; i < frameNames.length; i++) { value[i] = frames[i].isTrustedIE(); if(value[i] == true) { text[i] = "Trusted (Local Intranet)"; }else { 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>


. Thank you very much
. Here is the following code!
Reply With Quote
Bookmarks