Current location: Hot Scripts Forums » General Web Coding » JavaScript » Internet explorer restricting file from showing active content


Internet explorer restricting file from showing active content

Reply
  #1 (permalink)  
Old 06-09-05, 02:40 PM
Torbinsky Torbinsky is offline
Newbie Coder
 
Join Date: May 2005
Location: BC, Canada
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Angry Internet explorer restricting file from showing active content

Hello and thanks for reading my post.

Recently I've been really frustrated with IE's script blocking feature. I am working on a fairly simple web site where I have a nav bar with an onmouseover feature that triggers a layer to appear and disappear.

These layers contain sub links which are relevant to the particular global link that was selected.

I have the script all working, however, any time I go to view the web page, Internet Explorer gives me that little message saying:

"To help protect your security, Internet Explorere has restricted this file from showing active content that could access your computer. Click here for options..."

I have gone to other web sites which use plenty of javascript however, and I don't get this message. How are they doing it??? Is there a way to tell IE that the script is harmless or something? Am I using some method that IE says is dangerous?

Basically all my script does is check the screen resolution and change the visible properties of layers.

Thanks again to anyone who takes the time to read this.
Reply With Quote
  #2 (permalink)  
Old 06-09-05, 06:13 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
maybe because you are accessing the screen object it's complaining.. but it shouldn't however!
can you show the code?
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 06-10-05, 10:38 AM
Torbinsky Torbinsky is offline
Newbie Coder
 
Join Date: May 2005
Location: BC, Canada
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, here is the code:

<head>

<!-- Navigation Control //-->
<script type="text/javascript" language="javascript">
<!--
var time = 3000;
var numofitems = 9;

//menu constructor
function menu(allitems,thisitem,startstate){
callname= "gl"+thisitem;
divname="subglobal"+thisitem;
this.numberofmenuitems = 9;
this.caller = document.getElementById(callname);
this.thediv = document.getElementById(divname);
this.thediv.style.visibility = startstate;
}

//menu methods
function ehandler(event,theobj){
for (var i=1; i<= theobj.numberofmenuitems; i++){
var shutdiv =eval( "menuitem"+i+".thediv");
shutdiv.style.visibility="hidden";
}
theobj.thediv.style.visibility="visible";
}

function closesubnav(event){
if ((event.clientY <8)||(event.clientY > 210)){
for (var i=1; i<= numofitems; i++){
var shutdiv =eval('menuitem'+i+'.thediv');
shutdiv.style.visibility='hidden';
}
}
}
//-->
</script>
<!-- Navigation Control //-->
</head>

The calls to the script come from here:
**************************************************
<body onmousemove="closesubnav(event);">

<area shape="rect" coords="5,7,44,20" href="#" alt="Home" id="gl1" class="glink" onmouseover="ehandler(event,menuitem1);">
(8 more of these area shapes...)
**************************************************

#layers and html code in here...

<script type="text/javascript" language="javascript">
<!--
var menuitem1 = new menu(7,1,"hidden");
var menuitem2 = new menu(7,2,"hidden");
var menuitem3 = new menu(7,3,"hidden");
var menuitem4 = new menu(7,4,"hidden");
var menuitem5 = new menu(7,5,"hidden");
var menuitem6 = new menu(7,6,"hidden");
var menuitem7 = new menu(7,7,"hidden");
var menuitem8 = new menu(7,8,"hidden");
var menuitem9 = new menu(7,9,"hidden");
//-->
</script>
</body>
</html>
Reply With Quote
  #4 (permalink)  
Old 06-10-05, 10:41 AM
Torbinsky Torbinsky is offline
Newbie Coder
 
Join Date: May 2005
Location: BC, Canada
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Oh, and I tried it without the resolution checking script that I head running to see if that was the problem, but I still have the same problem.

Here's the script anyway:

function CheckRes()
{
var Res_1 = window.screen.width;
var Res_2 = window.screen.height;
if ((Res_1 == 1024) && (Res_2 == 768))
{
document.write("<link rel=stylesheet type=text/css href=Design.css media=screen>");
}
else if((Res_1 >= 1024) && (Res_2 >= 768))
{
document.write("<link rel=stylesheet type=text/css href=Design1.css media=screen>");
}
else
{
document.write("<link rel=stylesheet type=text/css href=Design_800.css media=screen>");
}
}
Reply With Quote
  #5 (permalink)  
Old 07-24-05, 05:26 AM
tzepuitoru tzepuitoru is offline
New Member
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Hy there ....

Just do the following simple thing :
Go to Internet Options.Select the "Advanced" tab . Scroll down to "Security"
and check the checkbox that says "Allow active content to run in files on My Computer"
If that checkbox is unchecked you will still get that annoying message mainly because you use any kind of script at all.
I'm glad to help any other programing friends.
Reply With Quote
  #6 (permalink)  
Old 07-24-05, 12:51 PM
angel.of.wisdom angel.of.wisdom is offline
Newbie Coder
 
Join Date: Jul 2005
Location: lisbon, portugal
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
i noticed that when Microsoft Internet Explorer finds a comment on the beginning of a file it will not block its scripts.
The comment will be like

<!-- saved from url=(0031)http://www.programmingtalk.com -->

try it!...
right on the beginning of the file (or after the DOCTYPE tag if you have one) put that comment AS IS. (0031) means that the following link has 31 characters. works for me

hope this helps anyone...

(forgive my english...)
Reply With Quote
  #7 (permalink)  
Old 07-24-05, 12:58 PM
angel.of.wisdom angel.of.wisdom is offline
Newbie Coder
 
Join Date: Jul 2005
Location: lisbon, portugal
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
when you save a page to your computer, that tag is automatically added to your files. that's why those scripts are executed on your computer and yours aren't.

(again, forgive my english)
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
When I used "application/vnd.ms-excel" to export table's content to Excel file. It wo miaomiaoga ASP 2 08-02-07 08:53 AM
showing realtime percentage of uploading file tallpaul858 PHP 2 06-01-05 02:04 PM
Error On Registeration timmy408 ASP 2 09-05-04 02:53 PM
Asp.net web controls are not showing in internet explorer shawais ASP.NET 3 05-04-04 05:16 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM


All times are GMT -5. The time now is 10:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.