Loading ...
Sorry, an error occurred while loading the content.

document.body has no properties .... container.js line: 976

Expand Messages
  • foggjacob
    Hey guys, for some reason I keep getting this error on this page... it looks like this line: var mProjectSelector = new
    Message 1 of 2 , May 1 10:40 AM
    • 0 Attachment
      Hey guys, for some reason I keep getting this error on this page... it
      looks like this line: "var mProjectSelector = new
      YAHOO.widget.Menu("ProjectSelectorMenu", { itemdata: aProjectSelector,
      lazyload: true, container: "bProjectSelector" });" is what is casusing
      the exception to be thrown... any thoughts on what I might be doing wrong?

      here is the code as I am currently using it:

      <!-- CSS Style sheets -->
      <link rel="stylesheet" href="styles/style.css" type="text/css">
      <link rel="stylesheet" href="styles/menubutton.css" type="text/css">
      <!-- combines menu.css and button.css -->
      <!-- YUI Javascript includes -->
      <script type="text/javascript"
      src="scripts/yui/yahoo-dom-event.js"></script>
      <script type="text/javascript"
      src="scripts/yui/element-beta-min.js"></script>
      <script type="text/javascript" src="scripts/yui/dragdrop-min.js"
      ></script>
      <script type="text/javascript" src="scripts/yui/animation-min.js"
      ></script>
      <script type="text/javascript" src="scripts/yui/container.js"></script>
      <script type="text/javascript" src="scripts/yui/menu-min.js"></script>
      <script type="text/javascript"
      src="scripts/yui/button-beta-min.js"></script>
      <!-- Site Javascript includes -->
      <script src="scripts/rollover.js" language="javascript"
      type="text/javascript"></script>
      <script src="scripts/bodyanimation.js" language="javascript"
      type="text/javascript"></script>
      <script src="scripts/fadeControlContainer.js" language="javascript"
      type="text/javascript"></script>
      <script src="scripts/help.js" language="javascript"
      type="text/javascript"></script>

      <script language="javascript" type="text/javascript">
      //setup the menubutton
      YAHOO.djo.init = function () {

      function onProjectSelectorItemClick(p_sType, p_aArgs, p_oItem) {
      alert(this.value);
      }
      var aProjectSelector = [
      { text: "menu 1 - item one", value: 1, onclick: { fn:
      onProjectSelectorItemClick } },
      { text: "menu 1 - item two", value: 2, onclick: { fn:
      onProjectSelectorItemClick } },
      { text: "menu 1 - item three", value: 3, onclick: { fn:
      onProjectSelectorItemClick } }
      ];

      var mProjectSelector = new YAHOO.widget.Menu("ProjectSelectorMenu", {
      itemdata: aProjectSelector, lazyload: true, container:
      "bProjectSelector" });
      var oProjectSelector = new YAHOO.widget.Button({ type: "menubutton",
      label: "Menu Button 1", menu: mProjectSelector, container:
      "bProjectSelector" });
      }
    • foggjacob
      okay, so I pulled my button initialization code out of the YAHOO.djo.init = function () { and placed it into a standard function and called it with a
      Message 2 of 2 , May 1 10:49 AM
      • 0 Attachment
        okay, so I pulled my button initialization code out of the
        "YAHOO.djo.init = function () {" and placed it into a standard
        function and called it with a document onload event... that fixed the
        problem, but I still don't understand why... any incite would be
        greatly appreciated!

        --- In ydn-javascript@yahoogroups.com, "foggjacob" <foggjacobn@...> wrote:
        >
        > Hey guys, for some reason I keep getting this error on this page... it
        > looks like this line: "var mProjectSelector = new
        > YAHOO.widget.Menu("ProjectSelectorMenu", { itemdata: aProjectSelector,
        > lazyload: true, container: "bProjectSelector" });" is what is casusing
        > the exception to be thrown... any thoughts on what I might be doing
        wrong?
        >
        > here is the code as I am currently using it:
        >
        > <!-- CSS Style sheets -->
        > <link rel="stylesheet" href="styles/style.css" type="text/css">
        > <link rel="stylesheet" href="styles/menubutton.css" type="text/css">
        > <!-- combines menu.css and button.css -->
        > <!-- YUI Javascript includes -->
        > <script type="text/javascript"
        > src="scripts/yui/yahoo-dom-event.js"></script>
        > <script type="text/javascript"
        > src="scripts/yui/element-beta-min.js"></script>
        > <script type="text/javascript" src="scripts/yui/dragdrop-min.js"
        > ></script>
        > <script type="text/javascript" src="scripts/yui/animation-min.js"
        > ></script>
        > <script type="text/javascript" src="scripts/yui/container.js"></script>
        > <script type="text/javascript" src="scripts/yui/menu-min.js"></script>
        > <script type="text/javascript"
        > src="scripts/yui/button-beta-min.js"></script>
        > <!-- Site Javascript includes -->
        > <script src="scripts/rollover.js" language="javascript"
        > type="text/javascript"></script>
        > <script src="scripts/bodyanimation.js" language="javascript"
        > type="text/javascript"></script>
        > <script src="scripts/fadeControlContainer.js" language="javascript"
        > type="text/javascript"></script>
        > <script src="scripts/help.js" language="javascript"
        > type="text/javascript"></script>
        >
        > <script language="javascript" type="text/javascript">
        > //setup the menubutton
        > YAHOO.djo.init = function () {
        >
        > function onProjectSelectorItemClick(p_sType, p_aArgs, p_oItem) {
        > alert(this.value);
        > }
        > var aProjectSelector = [
        > { text: "menu 1 - item one", value: 1, onclick: { fn:
        > onProjectSelectorItemClick } },
        > { text: "menu 1 - item two", value: 2, onclick: { fn:
        > onProjectSelectorItemClick } },
        > { text: "menu 1 - item three", value: 3, onclick: { fn:
        > onProjectSelectorItemClick } }
        > ];
        >
        > var mProjectSelector = new YAHOO.widget.Menu("ProjectSelectorMenu", {
        > itemdata: aProjectSelector, lazyload: true, container:
        > "bProjectSelector" });
        > var oProjectSelector = new YAHOO.widget.Button({ type: "menubutton",
        > label: "Menu Button 1", menu: mProjectSelector, container:
        > "bProjectSelector" });
        > }
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.