Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer blocks the Javascript

    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

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    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 and isn't likely to win you any fans.
    Last edited by Bill Posters; 04-24-2006 at 07:30 AM.

  • #3
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,680
    Thanks
    0
    Thanked 230 Times in 225 Posts
    Hi there manjeet799,

    you can also put a snippet of code, like this...
    Code:
    
    <!-- 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
    Last edited by coothead; 04-26-2006 at 04:41 PM.

  • #4
    New Coder
    Join Date
    Oct 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question problem with javascript and IE

    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/IM...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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •