Results 1 to 10 of 10

Thread: 'divclass' is null or not an object in Internet Explorer

  1. #1
    Join Date
    Aug 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default 'divclass' is null or not an object in Internet Explorer

    1) AnyLink JS Drop Down Menu

    2) http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Internet Explorer returns error 'divclass' is null or not an object in file anylinkmenu.js on line 248 and 249 which r bold.


    ===================================
    part of anylinkmenu.js
    =========================

    setupmenu:function(targetclass, anchorobj, pos){
    this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
    var relattr=anchorobj.getAttribute("rel")
    dropmenuid=relattr.replace(/\[(\w+)\]/, '')
    var dropmenuvar=window[dropmenuid]
    var dropmenu=this.addDiv(null, dropmenuvar.divclass, dropmenuvar.inlinestyle) //create and add main sub menu DIV
    dropmenu.innerHTML=this.getmenuHTML(dropmenuvar)

    var menu=this.menusmap[targetclass+pos]={
    id: targetclass+pos,
    anchorobj: anchorobj,
    dropmenu: dropmenu,
    revealtype: (relattr.length!=dropmenuid.length && RegExp.$1=="click")? "click" : "mouseover",
    orientation: anchorobj.getAttribute("rev")=="lr"? "lr" : "ud",
    shadow: this.addDiv(null, "anylinkshadow", null) //create and add corresponding shadow
    }

    Please help

  2. #2
    Join Date
    Aug 2004
    Posts
    9,890
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    Does this happen on the DD demo page, or just on your own. If the later, please post a link to it.
    DD Admin

  3. #3
    Join Date
    Aug 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    issue with my site only and not demo page. have no clue as to what am doing differently as i havent changed .js files. page is at www.vastech.co.ug/memd/annual.php no links are active. error appears in left corner of status bar. all files can be accessed from http://www.vastech.co.ug/memd/menucontents.js replacing menucontents.js with file to view,names still defaults. please help,kinda desperate here

  4. #4
    Join Date
    Aug 2004
    Posts
    9,890
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    There are a few obvious errors with your menu anchor links:

    Code:
    <table cellspacing="0" cellpadding="0" bgcolor="#818b9d"><tr><td ce>
         <a href="index.php" lass="menuanchorclass" rel="anylinkmenu4"  rev="lr"  data-image="images/home1.gif" data-overimage="images/home2.gif"><img src="images/home1.gif" style="border-width:0" /></a><br>
        <a href="" class="menuanchorclass" rel="anylinkmenu1" rev="lr" data-image="images/about1.gif" data-overimage="images/about2.gif"><img src="images/about1.gif" border="0" /></a><br>    
    	<a href="" class="menuanchorclass" rel="anylinkmenu2" rev="lr" data-image="images/pol1.gif" data-overimage="images/pol2.gif"><img src="images/pol1.gif" width="150" height="29" border="0" /></a><br>
        <a href="" class="menuanchorclass" rel="anylinkmenu3" rev="lr" data-image="images/proj1.gif" data-overimage="images/proj2.gif"><img src="images/proj1.gif" border="0" /></a><br>
    
        <a href="" class="menuanchorclass" rel="anylinkmenu4" rev="lr" data-image="images/pub1.gif" data-overimage="images/pub2.gif"><img src="images/pub1.gif" border="0" /></a><br>
    
        <a href="" class="menuanchorclass" rel="anylinkmenu5" rev="lr" data-image="images/faq1.gif" data-overimage="images/faq2.gif"><img src="images/faq1.gif" border="0" /></a><br>    
        <a href="" class="menuanchorclass" rel="anylinkmenu6" rev="lr" data-image="images/links1.gif" data-overimage="images/links2.gif"><img src="images/links1.gif" border="0" /></a><br>
    	<a href="" class="menuanchorclass" rel="anylinkmenu7" rev="lr" data-image="images/what1.gif" data-overimage="images/what2.gif"><img src="images/what1.gif" border="0" /></a><br>
        <a href="" class="menuanchorclass" rel="anylinkmenu8" rev="lr" data-image="images/media1.gif" data-overimage="images/media2.gif"><img src="images/media1.gif" border="0" /></a><br>
        <a href="" class="menuanchorclass" rel="anylinkmenu9" rev="lr" data-image="images/album1.gif" data-overimage="images/album2.gif"><img src="images/album1.gif" border="0" /></a><br>	
    	<a href="" class="menuanchorclass" rel="anylinkmenu10" rev="lr" data-image="images/opps1.gif" data-overimage="images/opps2.gif">		<img src="images/opps1.gif" width="120" height="30" border="0" /></a><br>   
        <a href="contacts.php" class="menuanchorclass"  data-image="images/contact1.gif" data-overimage="images/contact2.gif"><img src="images/contact1.gif" border="0" /></a><br>
    	
    		   </td>
        </tr></table>
    I've highlighted the errors in red. Firstly, in your first link, "lass" should be "class". You should probably just remove that link, as it appears to be redundant. Moving along, with your last link, it's missing a rel attribute pointing to the desired sub menu, which is required.
    DD Admin

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    ank5 (08-07-2009)

  6. #5
    Join Date
    Aug 2009
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks. working fine now in internet explorer. Corrected errors in red and is all good. Appreciate the help big time.

  7. #6
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ie8

    Damn i hate IE! lol

    Im using IE8 and im having the same problem... I've checked the html and the js and its all OK...

    IE keep saying: 'divclass' is null or not an object."

    Heres the link:
    http://www.alteracis.com.br/happyden...estemenu2.html
    (the dropdown comes on SOBRE in the menu.)

    HTML code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Happydent's</title>
    <link rel="stylesheet" href="site.css" type="text/css" media="screen" />
    <link href="scroll.css" rel="stylesheet" type="text/css" />
    <link href="scrollstyles.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="scroll.js"></script>
    <script type="text/javascript" src="load.js"</script>
    <link rel="stylesheet" type="text/css" href="drop/anylinkmenu.css" />
    <script type="text/javascript" src="drop/menucontents.js" charset="ISO-8859-1"></script>
    <script type="text/javascript" src="drop/anylinkmenu.js" charset="ISO-8859-1">
    
    /***********************************************
    * AnyLink JS Drop Down Menu v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
    ***********************************************/
    
    
    </script>
    <script type="text/javascript">
    
    //anylinkmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu)
    anylinkmenu.init("menuanchorclass")
    
    </script>
    </head>
    <body>
    <div id="menu" align="center"><img src="menu/logo.jpg" width="258" height="137" /><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','menu/home2.jpg',1)"><img src="menu/home.jpg" alt="home" name="home" width="75" height="137" border="0" id="home" /></a><img src="menu/div.jpg" width="9" height="137" />
    <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sobre','','menu/sobre2.jpg',1)" class="menuanchorclass" rel="anylinkmenu4">
    <img src="menu/sobre.jpg" alt="sobre" name="sobre" width="73" height="137" border="0" id="sobre" /></a><img src="menu/div.jpg" width="9" height="137" /><a href="servicos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('servicos','','menu/servicos2.jpg',1)"><img src="menu/servicos.jpg" alt="serviços" name="servicos" width="98" height="137" border="0" id="servicos" /></a><img src="menu/div.jpg" width="9" height="137" /><a href="parceiros.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('parceiros','','menu/parceiros2.jpg',1)"><img src="menu/parceiros.jpg" alt="parceiros" name="parceiros" width="109" height="137" border="0" id="parceiros" /></a><img src="menu/div.jpg" width="9" height="137" /><a href="contato.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contato','','menu/contato2.jpg',1)"><img src="menu/contato.jpg" alt="contato" name="contato" width="112" height="137" border="0" id="contato" /></a></div>
    the .js files:
    http://www.alteracis.com.br/happyden...anylinkmenu.js
    http://www.alteracis.com.br/happyden...enucontents.js

    How to fix that? Its possible to fix this issue in ie8???

    Thanks guys!

  8. #7
    Join Date
    Aug 2004
    Posts
    9,890
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    Hmm at a glance I don't see any issues except for the following code in the HEAD section of your page:

    Code:
    <script type="text/javascript" src="load.js"</script>
    It's missing a closing ">" tag following "load.js".
    DD Admin

  9. #8
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I closed the tag, but the problem persists.
    I dont understand, its all ok but the menu just dont work on IE!

    Did you guys can sugest another cool and simple dropdown menu that works well on IE 6+???

    Thanks for the help!

  10. #9
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Apologies if this is not the correct place to submit this... Any clues on how to fix, or where to look, please? Thank you.

    Dropdowns work in FF and IE7. Now on IE8 I get this error:

    Message: 'items[...].1' is null or not an object
    Line: 167
    Char: 3
    Code: 0
    URI: file://...../anylinkmenu.js

    Line 167 is the one that begins ' frag+=...."

    getmenuHTML:function(menuobj){
    var menucontent=[]
    var frag=""
    for (var i=0; i<menuobj.items.length; i++){
    frag+='<li><a href="' + menuobj.items[i][1] + '" target="' + menuobj.linktarget + '">' + menuobj.items[i][0] + '</a></li>\n'
    if (menuobj.items[i][2]=="efc" || i==menuobj.items.length-1){
    menucontent.push(frag)
    frag=""
    }
    }
    if (typeof menuobj.cols=="undefined")
    return '<ul>\n' + menucontent.join('') + '\n</ul>'
    else{
    frag=""
    for (var i=0; i<menucontent.length; i++){
    frag+='<div class="' + menuobj.cols.divclass + '" style="' + menuobj.cols.inlinestyle + '">\n<ul>\n' + menucontent[i] + '</ul>\n</div>\n'
    }
    return frag
    }
    },

  11. #10
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Of course, the way to fix the problem is to post it here - then you'll find the answer yourself....

    menucontents.js had a last dropdown content line that ended with "]," instead of just "]"

    But (for once, in this case) good for IE8 for being picky...

    Should be:
    anylinkmenu114.items=[
    ["Twitter","http://twitter.com/kurc"],
    ["Flickr","http://www.flickr.com/photos/kingstonurc/"] //No comma here....
    ]

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
  •