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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Location
    Pretoria, South Africa
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Undefined *.js refernce => NEED HELP

    Hi All,
    I'm new to JavaScript and need help pse. I have several scripts defining *.js files from where I run a navigation menu, declared in the HEAD section. When code executes it accesses other code, also *.js files but not declared in the head. I furthermore have other SCRIPTS in the head not related to the menu. When I do the window.onload to run all scripts the debugger tells me that some code is not defined. How do I define this code? The undefined code referred to is the 'other' files accessed by the menu operation.

  • #2
    New to the CF scene
    Join Date
    Feb 2003
    Location
    Pretoria, South Africa
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post The Code looks like this

    <head>
    <title></title>
    <script language="javascript" src="sniffer.js"></script>
    <script language="javascript1.2" src="custom.js"></script>
    <script language="javascript1.2" src="style.js"></script>
    <script>
    //Title Animation
    var titletext=""
    var thetext=""
    var started=false
    var step=0
    var times=1
    function welcometext()
    {
    times--
    if (times==0)
    {
    if (started==false)
    {
    started = true;
    document.title = titletext;
    setTimeout("anim()",1);
    }
    thetext = titletext;
    }
    }
    function showstatustext(txt)
    {
    thetext = txt;
    setTimeout("welcometext()",4000)
    times++
    }
    function anim()
    {
    step++
    if (step==7) {step=1}
    if (step==1) {document.title='>==='+thetext+'===<'}
    if (step==2) {document.title='=>=='+thetext+'==<='}
    if (step==3) {document.title='>=>='+thetext+'=<=<'}
    if (step==4) {document.title='=>=>'+thetext+'<=<='}
    if (step==5) {document.title='==>='+thetext+'=<=='}
    if (step==6) {document.title='===>'+thetext+'<==='}
    setTimeout("anim()",200);
    }
    if (document.title)
    window.onload=onload=welcometext;menu_ie5.loadFunction;menu_ie4.loadFunction;
    </script>
    </head>

    When I execute it tells me that menu_ie5 is not defined. What now? Thanks a lot.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Try takin' one of those onloads out at the bottom...See it?

    I'm a bit rusty and if that doesn't work, try:

    window.onload=welcometext();menu_ie5.loadFunction();menu_ie4.loadFunction();
    Last edited by zoobie; 02-27-2003 at 08:52 AM.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    New to the CF scene
    Join Date
    Feb 2003
    Location
    Pretoria, South Africa
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Not the problem

    The 2 onloads is not the problem. The page loads and works correctly but in the status bar left bottom corner where it says done is a error sign telling me that menu_ie5 is not defined.
    I don't know how to define menu_ie5 in the script section where I call the onload=....

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    where did you define menu_ie5? can you post the 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
    •