[ 2 posts ]

Andy

  • Username: menuFailure
  • Joined: Wed Jul 04, 2012 2:09 am
  • Posts: 1
  • Offline
  • Profile
Tags:

Help with MenuBar failure

Post Posted: Wed Jul 04, 2012 2:16 am
+0-
Hi There,

I'm a web developer for a company and have to migrate a bespoke site from one server to another. I've partially got it working yet when I log into it, I get an alert telling me to contact IT. Obviously I can't do this, and the ex-developers implemented this.

I hoped you guys could tell me whats going wrong in the javascript code, as I don't understand it. the code is:

Code:
var theMenu;

window.onload = function() {
   theMenu = new YAHOO.widget.MenuBar("theMenu", { autosubmenudisplay: true, hidedelay: 750, lazyload: true, iframe: true });
   
   var callback = {
        success : function (o) {
         try {
            var aItems = YAHOO.lang.JSON.parse(o.responseText);
            renderMenu(aItems);
         }
         catch(x) {
            alert('[b]There is an error with your menu data, contact IT[/b].');
         }
         
      },
      failure : function (o) {
            if (!YAHOO.util.Connect.isCallInProgress(o)) {
                alert('Error retreiving menu data, contact IT.');
            }
        }
   };


I have bolded the error that comes up.

Thanks

Jeremy Buchmann

  • Username: jlb_acplus
  • Joined: Mon Feb 08, 2010 2:01 pm
  • Posts: 1
  • Offline
  • Profile

Re: Help with MenuBar failure

Post Posted: Fri Jul 06, 2012 9:22 am
+0-
I'd guess that the YAHOO.lang.JSON.parse() function is throwing the exception. Open the page in Firebug and look at the value of o.responseText. If it's not JSON, that's your problem.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
cron