Web Analytics Made Easy -
StatCounter JS error: Object Expected - CodingForum

Announcement

Collapse
No announcement yet.

JS error: Object Expected

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JS error: Object Expected

    I have a very frustrating problem...I have two scripts that normally work great together under Win2k3 Web but when I try to run the same scripts on my Win2k server one does not work correctly. I'm not a javascript programmer so I have no clue what to look for. However, if someone can have a look at the following code and offer any suggestions I will GREATLY appreciate it!!

    index.php
    Code:
    <HEAD>
    <SCRIPT src="rightmenu.js" type=text/javascript>
    
    //Right-click menu- By Eyecon ([url]http://www.webteam.ro[/url])
    //Slight modifications by JK
    //Visit JavaScript Kit ([url]http://javascriptkit.com[/url]) for script
    
    </SCRIPT>
    
    <style>
    <!--
    #men {
    BORDER-RIGHT: 2px outset; BORDER-TOP: 2px outset; Z-INDEX: 1; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: 2px outset; BORDER-BOTTOM: 2px outset; POSITION: absolute; TOP: 0px
    }
    #men A {
    PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 4px; MARGIN: 1px 1px 1px 16px; FONT: 12px sans-serif; WIDTH: 100%; PADDING-TOP: 3px; HEIGHT: 100%; TEXT-DECORATION: none
    }
    .ico {
    BORDER-RIGHT: medium none; BORDER-TOP: medium none; FLOAT: left; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none
    }
    //-->
    </style>
    <script language="JavaScript">
    <!--
    
    /*
    Slowly coming together status bar scroller
    Written by BengalBoy ([url]www.angelfire.com/nt/bengaliboy/index.html[/url])
    Visit [url]http://javascriptkit.com[/url] for this script and more
    */
    
    //set message:
    msg = "Welcome to the -::|DWG|::- Clan Site!";
    
    timeID = 10;
    stcnt = 16;
    wmsg = new Array(33);
            wmsg[0]=msg;
            blnk = "                                                               ";
            for (i=1; i<32; i++)
            {
                    b = blnk.substring(0,i);
                    wmsg[i]="";
                    for (j=0; j<msg.length; j++) wmsg[i]=wmsg[i]+msg.charAt(j)+b;
            }
    
    function wiper()
    {
            if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
            if (stcnt-- < -40) stcnt=31;
            status = str;
            clearTimeout(timeID);
            timeID = setTimeout("wiper()",100);
    }
    
    wiper()
    // -->
    </script>
    </HEAD>
    <BODY>
    <SCRIPT type=text/javascript>
    //MENU TITLE
    eyesys_title="-::|DWG|::- Menu"
    //TITLE BACKGROUND COLORS
    eyesys_titlecol1="silver"
    eyesys_titlecol2="black"
    //TITLE COLOR
    eyesys_titletext="white"
    //MENU & ITEM BACKGROUND COLOR
    eyesys_bg="#1c1c1c"
    //ITEM BACKGROUND COLOR ON MOUSE OVER
    eyesys_bgov="#9c9c9c"
    //MENU COLOR
    eyesys_cl="white"
    //MENU COLOR ON MOUSE OVER
    eyesys_clov="white"
    //MENU WIDTH
    eyesys_width=160
    //menu starts here
    eyesys_init() [color=red]<-------This is where the script crashes[/color]
    //menu item sintax:  eyesys_item(text,icon,link)
    //for no icon use 'null'
    eyesys_item('Home','home.gif','http://www.dwg.ch')
    eyesys_item('Server Status',null,'http://www.dwg.ch/index.php?page=csstatus')
    eyesys_item('Member Application',null,'http://www.dwg.ch/index.php?page=application')
    eyesys_item('Member Profiles',null,'http://www.dwg.ch/index.php?page=profiles')
    eyesys_item('War Challenge',null,'http://www.dwg.ch/index.php?page=challenge')
    eyesys_item('War Results',null,'http://www.dwg.ch/index.php?page=war%20results')
    eyesys_item('Clan Forum',null,'http://www.dwg.ch/forum/index.php')
    eyesys_item('Downloads',null,'http://www.dwg.ch/index.php?page=downloads')
    eyesys_item('Member Login',null,'http://www.dwg.ch/index.php?page=membersonly')
    eyesys_item('Admin Login',null,'http://www.dwg.ch/admin.php')
    //mene closes here
    eyesys_close()
    </SCRIPT>
    </BODY>
    First script refers to the "rightmenu.js file"...contents below...

    Code:
    //eyesys dhtml  (c)eyecon 2002 [ [email][email protected][/email] ]
    //visit [url]www.webteam.ro[/url] for great scripts and tutorials
    
    var ie5=window.createPopup
    
    if (ie5)
    document.oncontextmenu=init;
    var eyesys="";
    var preitem="";
    function init(){
    mx=event.clientX;
    my=event.clientY;
    menx=window.screenLeft+mx;
    meny=window.screenTop+my;
    sysmen=window.createPopup();
    sysmen.document.write(eyesys);
    sysmen.show(menx,meny,eyesys_width,document.getElementById('men').offsetHeight);
    return false
    };
    function eyesys_init(){
    if (ie5){
    eyesys+=("<style type='text/css'>.textul{position:absolute;top:0px;color:"+eyesys_titletext+";writing-mode:	tb-rl;padding-top:10px;filter: flipH() flipV() dropShadow( Color=000000,offX=-2,offY=-2,positive=true);z-Index:10;width:100%;height:100%;font: bold 12px sans-serif}.gradientul{position:relative;top:0px;left:0px;width:100%;background-color:"+eyesys_titlecol2+";height:100%;z-Index:9;FILTER: alpha( style=1,opacity=0,finishOpacity=100,startX=100,finishX=100,startY=0,finishY=100)}.contra{background-color:"+eyesys_titlecol1+";border:1px inset "+eyesys_bg+";height:98%;width:18px;z-Index:8;top:0px;left:0px;margin:2px;position:absolute;}.men{position:absolute;top:0px;left:0px;padding-left:18px;background-color:"+eyesys_bg+";border:2px outset "+eyesys_bg+";z-Index:1;}.men a{margin:1px;cursor:default;padding-bottom:4px;padding-left:1px;padding-right:1px;padding-top:3px;text-decoration:none;height:100%;width:100%;color:"+eyesys_cl+";font:normal 12px sans-serif;}.men a:hover{background:"+eyesys_bgov+";color:"+eyesys_clov+";} BODY{overflow:hidden;border:0px;padding:0px;margin:0px;}.ico{border:none;float:left;}</style><div class='men'>")
    }
    };
    
    function eyesys_item(txt,ico,lnk){
    if (ie5){
    if(!ico)ico='s.gif';
    preitem+=("<a href='#' onmousedown='parent.window.location.href=\""+lnk+"\"'><img src='"+ico+"' width='16' height='16' class='ico'> "+txt+"</a>")
    }
    };
    
    function eyesys_close(){
    if (ie5){
    eyesys+=preitem;
    eyesys+=("</div><div class='contra'><div class='gradientul'></div><div class='textul' id='titlu'>"+eyesys_title+"</div></div>");
    document.write("<div id='men' style='width:"+eyesys_width+"'></div>");
    document.getElementById('men').innerHTML=preitem
    }
    }
    Besides the OS version difference the only other difference that I am aware of is the version of iis...win2k iis V.5 win2k3 iis v.6 and iexplorer versions differ slightly...win2k3 ie version 6.0.3790, win2k ie version 6.0.2800.1106 both are 128 bit encryption (not that it matters).

    Thanks in advance for any help you guys may be able to offer!!

    BTW...local server...no links sorry...

  • #2
    That's the first function call to rightmenu.js

    If its failing i would think that rightmenu.js is somehow not loaded...

    You sure that the file rightmenu.js is in the same folder as the index.php file?
    Nobody is Perfect. I am Nobody.

    Comment


    • #3
      Yeah, that was the first thing I checked. I did a direct copy from one machine to the other with the same results. Is there maybe sometihng special I need to do on the win2k server to make this work right? i.e. ISAPI filter maybe? All the code looks ok then right? My guess is maybe the server is missing a checked check box...typical of MS I know...LOL maybe I'll just keep win2k3...?

      Comment

      Working...
      X