javascript - Please help! Error: The value of the property 'Menu_Unhover' is null or undefined, not a Function object -
i appreciate if help me out here.
i have global navigation bar i'm using in sharepoint 2010. every time apply script, next error messages whenever mouseover/mouseout of menu. console gets terribly junked these error messages, , unfortunately in ie8, shows error on page. need rid of them.
line: 1 error: value of property 'menu_unhover' null or undefined, not function object
line: 1 error: value of property 'menu_hoverdynamic' null or undefined, not function object
line: 1 error: value of property 'menu_hoverroot' null or undefined, not function object
here's code.
jquery.noconflict(); jquery(document).ready(function($){ /* format extendedtabs: extendedtabs(tabside, titletabname, urltab, listname, listsiteurl) tabside: prepend, adds tab global navigation bar titletabname: display name of tab in global navigation bar urltab: url tab name links to, example: http://www.google.com listname: name of list maintains links displayed under tab listsiteurl: url sharepoint site list tab maintained, not include /lists/ in url */ extendedtabs('prepend', ' hq', '', 'globalnav_hq', 'http://mysite/'); extendedtabs('prepend', 'organizations', '', 'globalnav_orgs', 'http://mysite/'); extendedtabs('prepend', 'communities', '', 'globalnav_communities', 'http://mysite/'); extendedtabs('prepend', 'tools', '', 'globalnav_tools', 'http://mysite/'); extendedtabs('prepend', 'leadership', '', 'globalnav_leadership', 'http://mysite/'); extendedtabs('prepend', ' support', '', 'globalnav_support', 'http://mysite/'); var = 1; function extendedtabs(tabside,titletabname,urltab,listname,listsiteurl) { //alert("in function"); var titletabid = 'zz1_new_topnavigationmenun' + titletabname.replace(/[-' ']/g,''); var showtabpd = titletabid + 'show'; var showtabappend = titletabid + 'append'; //alert("urltab "+urltab); if (urltab != '') { var urltabshow = 'href=' + urltab; } else { var urltabshow = ''; } var tablerow = '<td id="' + titletabid + '" onkeyup="menu_key(event)" onmouseout="menu_unhover(this)" onmouseover="menu_hoverroot(this)" class="tab-outer-container"><table width="100%" cellspacing="0" cellpadding="0" border="0" style="" class="ms-topnav zz1_topnavigationmenu_4"><tbody><tr id="mouse"><td style="white-space: nowrap;"><a ' + urltabshow + ' style="" class="zz1_topnavigationmenu_1 ms-topnav zz1_topnavigationmenu_3">' + titletabname + '</a><td valign="top" style="width:0pt;" ><img style="border-style:none; vertical-align:top;" alt="" src="http://mysite//globalnavscripts/dropdown.png"></td></tr></tbody></table><div style="position:absolute;height: 0px;z-index:1;"><div id="' + showtabpd + '" class="zz1_topnavigationmenu_8" style=""><table cellspacing="0" cellpadding="0" border="0" style="top: 0px;" id="' + showtabappend + '"></table></div></div></td>'; //alert("tblrow: "+tablerow); if (tabside == 'append') { $('table#zz1_new_topnavigationmenu').children().children().prepend(tablerow); } else { $('table#zz1_new_topnavigationmenu').children().children().append(tablerow); } $().spservices({ operation: "getlistitems", weburl: listsiteurl, listname: listname, completefunc: function (xdata, status) { //alert(xdata.responsexml.xml); $(xdata.responsexml).spfilternode('z:row').each(function() { var urldatatn1 = $(this).attr("ows_url").split(','); //alert("url "+urldatatn1); var linkstn1 = $(this).attr("ows_linktype"); //alert(linkstn1); if (linkstn1 == 'header') { $('#' + showtabappend).append('<tr id="zz1_new_topnavigationmenun' + + '" onkeyup="menu_key(event)" onmouseout="menu_unhover(this)" onmouseover="menu_hoverdynamic(this)"><td><table cellspacing="0" cellpadding="0" border="0" width="100%" class="ms-topnavflyouts zz1_topnavigationmenu_7 ms-topnavflyoutshover"><tbody><tr><td style="white-space: nowrap; width: 100%;"><a style="" class="zz1_topnavigationmenu_1 ms-topnavflyouts zz1_topnavigationmenu_6 ms-topnavflyoutshover"><strong>' + urldatatn1[1] + '</strong></a></td></tr></tbody></table></td></tr>'); //$('#' + showtabappend).append('<tr id="zz1_new_topnavigationmenun' + + '" ><a style="border-style: none; font-size: 1em;" class="zz1_topnavigationmenu_1 ms-topnavflyouts zz1_topnavigationmenu_6 ms-topnavflyoutshover"><strong>' + urldatatn1[1] + '</strong></a></td></tr></tbody></table></td></tr>'); i++; } else if (linkstn1 == 'header link') { $('#' + showtabappend).append('<tr id="zz1_new_topnavigationmenun' + + '" onkeyup="menu_key(event)" onmouseout="menu_unhover(this)" onmouseover="menu_hoverdynamic(this)"><td><table cellspacing="0" cellpadding="0" border="0" width="100%" class="ms-topnavflyouts zz1_topnavigationmenu_7 ms-topnavflyoutshover"><tbody><tr><td style="white-space: nowrap; width: 100%;"><a style="" href="' + urldatatn1[0] + '" class="zz1_topnavigationmenu_1 ms-topnavflyouts zz1_topnavigationmenu_6 ms-topnavflyoutshover"><strong>bbb' + urldatatn1[1] + '</strong></a></td></tr></tbody></table></td></tr>'); i++; } else { //alert("0: "+urldatatn1[0]+"1: "+urldatatn1[1]); $('#' + showtabappend).append('<tr id="zz1_new_topnavigationmenun' + + '" onkeyup="menu_key(event)" onmouseout="menu_unhover(this)" onmouseover="menu_hoverdynamic(this)"><td><table cellspacing="0" cellpadding="0" border="0" width="100%" class="ms-topnavflyouts zz1_topnavigationmenu_7"><tbody><tr><td style="white-space: nowrap; width: 100%;"><a style="" href="' + urldatatn1[0] + '" class="zz1_topnavigationmenu_1 ms-topnavflyouts zz1_topnavigationmenu_6">' + urldatatn1[1] + '</a></td></tr></tbody></table></td></tr>'); i++; } }); } }); $('#' + titletabid).mouseover(function(){ $('#' + showtabpd).show(); }); $('#' + titletabid).mouseleave(function(){ $('#' + showtabpd).hide(); }); } }); the odd thing not impede functionality. also, error message, although showing on browsers, prominent on ie8, displays "error on page" message @ bottom left hand corner of page.
i've tried different things, such js file order, performing try/catch statement (which doesn't work on either), , have googled extensively without results. tried suppressing errors, works, that's not optimal.
i'd appreciate assistance. thanks!
you calling functions doesn't seem exist in line (and in other lines well): must either declare functions or remove eventhandlers calls undefined functions.
var tablerow = '<td id="' + titletabid + '" onkeyup="menu_key(event)" onmouseout="menu_unhover(this)" onmouseover="menu_hoverroot(this)" class="tab-outer-container"><table width="100%" cellspacing="0" cellpadding="0" border="0" style="" class="ms-topnav zz1_topnavigationmenu_4"><tbody><tr id="mouse"><td style="white-space: nowrap;"><a ' + urltabshow + ' style="" class="zz1_topnavigationmenu_1 ms-topnav zz1_topnavigationmenu_3">' + titletabname + '</a><td valign="top" style="width:0pt;" ><img style="border-style:none; vertical-align:top;" alt="" src="http://mysite//globalnavscripts/dropdown.png"></td></tr></tbody></table><div style="position:absolute;height: 0px;z-index:1;"><div id="' + showtabpd + '" class="zz1_topnavigationmenu_8" style=""><table cellspacing="0" cellpadding="0" border="0" style="top: 0px;" id="' + showtabappend + '"></table></div></div></td>'; javascript jquery internet-explorer-8
No comments:
Post a Comment