SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: Runtime Error

Hybrid View

  1. #1
    SitePoint Member QLink's Avatar
    Join Date
    Nov 2003
    Location
    Qatar
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Runtime Error




    hello,
    I have created two drop-down menus' in my site (Using Frontpage 2002) but each time i try to select one of the links an error window (Runtime Error) comes up..

    Drop-down menu code for menu1..
    <font face="Arial" size="7" color="#ffffff"><select name="menu1" style="background-color: #000000 ; color:#ffffff; font-style:normal; font-variant:normal; font-weight:normal; font-size:10" size="1" onChange="MM_jumpMenu('parent',this,0)" dir="rtl">
    <option selected>&gt;&gt;</option>
    <option value="http://www.one.com">1</option>
    <option value="http://www.two.com">2</option>
    <option value="http://www.three.com">3</option>
    <option value="http://www.four.com">4</option>
    </select></font></p>
    -----------------------------------------------------
    For this code i get an error msg of
    A Runtime Error has occured
    Do you wish to Debug?

    Line: 96
    Error: Object expected


    Drop-down menu code for menu2....
    <font face="Arial" size="7" color="#ffffff"><select name="menu2" style="background-color: #000000 ; color:#ffffff; font-style:normal; font-variant:normal; font-weight:normal; font-size:10" size="1" onChange="MM_jumpMenu('parent',this,0)" dir="rtl">
    <option selected>&gt;&gt;</option>
    <option value="http://www.google.com">Google</option>
    <option value="http://www.yahoo.com">Yahoo</option>
    <option value="http://www.microsoft.com">Microsoft</option>
    <option value="http://www.nokia.com">Nokia</option>
    <option value="http://www.support.com">Support</option>
    </select></font></p>
    ---------------------------------------------------------
    For this code i get an error msg of
    A Runtime Error has occured
    Do you wish to Debug?

    Line: 108
    Error: Object expected


    Thank you for taking the time to help me with this..

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by QLink



    'Object Expected' means that JavaScript can't find that function - MM_jumpMenu() - in order to run it. Do you have it embedded in the page? Re-paste it in there:
    Code:
    function MM_jumpMenu(targ,selObj,restore){ //v3.0 
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
    if (restore) selObj.selectedIndex=0; 
    }
    ...and see if that helps. If not, you'll probably need to post more of your page (or a url).
    my post is bigger than your post.
    ::: certified wild guess :::

  3. #3
    SitePoint Member QLink's Avatar
    Join Date
    Nov 2003
    Location
    Qatar
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)



    My page already has this MM_jumpMenu code..

    Try http://qatarsoul.com
    You can view the source code of the page too..

    Thanks for your time..

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    QLink: if the function is in there, it's well hidden!
    Code:
    <script type="text/javascript" language="javascript">
    
    function MM_jumpMenu(targ,selObj,restore){ //v3.0 
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'" ); 
    if (restore) selObj.selectedIndex=0; 
    } 
    
    </script>
    Put this above the closing </head> tag. Also, move your stylesheet into the <head>.
    ::: certified wild guess :::

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ::: certified wild guess :::

  6. #6
    SitePoint Member QLink's Avatar
    Join Date
    Nov 2003
    Location
    Qatar
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I am really grateful..

    Thanks a MILLION.. It worked now..

    Can you explain more about moving the stylesheet into the <head>?? I didn't understand ..

  7. #7
    SitePoint Member QLink's Avatar
    Join Date
    Nov 2003
    Location
    Qatar
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What section exactly should i read please?? I am lost..
    i am a beginner..

  8. #8
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So start at the beginning...

    http://www.w3schools.com/css/css_intro.asp
    ::: certified wild guess :::

  9. #9
    SitePoint Member QLink's Avatar
    Join Date
    Nov 2003
    Location
    Qatar
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good idea
    Thanks for your help on everything..


Bookmarks

Posting Permissions

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