...

View Full Version : Internet Explorer blocks the Javascript



manjeet799
04-24-2006, 06:47 AM
Hi,

I have a simple Javascript in my html page. It only displays a message but the internet explorer blocks it by showing it as a active content. If I check the checkbox 'Allow active content' in advanced browser setting it works fine.

Can anybody give me piece of code so that my browser allows the javascript.


Regards,
Manjeet

Bill Posters
04-24-2006, 07:27 AM
Iirc, this is something that IE does when it encounters javascripts in local documents (pages stored and run from the hard-drive). It doesn't do it (by default) with scripts encountered in online pages.
As you've found out, changing the settings in Internet Options should allow you to disable the warning when running javascripts on local documents.


Btw, avoid cross-posting your query in more than one section of the forum. It goes against the forum posting rules (http://www.codingforums.com/rules.htm) and isn't likely to win you any fans.

coothead
04-24-2006, 12:24 PM
Hi there manjeet799,

you can also put a snippet of code, like this...


<!-- saved from url=(0044)http://coothead.mysite.wanadoo-members.co.uk -->

...directly after the DOCTYPE if you do not wish to alter your Internet Options Settings.

coothead

pkarovsky
07-12-2006, 02:57 AM
I have a set of pages that work OK in Netscape and FireFox but in IE i get a blank page and a message saying there is a syntax error. See URL http://www.krstudios.com/testsite/IMAGES/atrium/01ClevelandSt/cleveland.html

This page is linked to a template. Here is the code from the template.

<code>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="doctitle" -->
<title></title>
<!-- TemplateEndEditable -->
<script type="text/javascript" src="../LINKS/javascript/Menu1/ie5.js"></script>
<script type="text/javascript" src="../LINKS/javascript/Menu1/DropDownMenu1.js"></script>
<script type="text/javaScript">

function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
origWidth = window.innerWidth; origHeight = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr; // holds id of currently visible layer
function swapLayers(id) {
if (cur_lyr) hideLayer(cur_lyr);
showLayer(id);
cur_lyr = id;
}

function showLayer(id) {
var lyr = getElemRefs(id);
if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
var lyr = getElemRefs(id);
if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
if (el) el.css = (el.style)? el.style: el;
return el;
}
</script>

<link href="../STYLESHEETS/primary.css" rel="stylesheet" type="text/css">
<link href="../LINKS/javascript/Menu1/dropdown.css" rel="stylesheet" type="text/css">
</head>
<body onload="swapLayers('lyr1')">
</code>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum