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

Re: [ydn-javascript] Issue using YMaps and YUI Tabview together

Expand Messages
  • Ken Robinson
    ... Make sure you include the Yahoo Maps Javascript before the YUI Javascript. I had a similar problem when I was including the Maps Javascript after the YUI.
    Message 1 of 3 , Nov 30, 2006
    • 0 Attachment
      At 03:45 PM 11/30/2006, orbit517 wrote:
      >I'm trying to build a page using YMap and Tabview together and when I
      >have the source file for the map, I get a javascript error and the
      >tabview is not rendered.
      >
      >The javascript error is:
      >
      >YAHOO.util.Event.OnContentReady is not a function
      >
      >When I remove the YMap source file, the tabview works and I don't get
      >the above javascript error.

      Make sure you include the Yahoo Maps Javascript before the YUI
      Javascript. I had a similar problem when I was including the Maps
      Javascript after the YUI.

      Ken
    • Culler, Sherman
      Unfortunately, that didn t work for me. The YMap source file itself includes event, dom, animation, and dragdrop js files. The tabview also requires these but
      Message 2 of 3 , Nov 30, 2006
      • 0 Attachment

        Unfortunately, that didn’t work for me.

         

        The YMap source file itself includes event, dom, animation, and dragdrop js files.  The tabview also requires these but apparently it cannot find the YAHOO.util.Event.onContentReady function in those included from the YMap source file.

         

        Here is how I have it setup now (which works perfectly):

         

        <script type="text/javascript" src="js/maps.js"></script>

        <script type="text/javascript" src="/beta/js/yui/yahoo.js"></script>

        <script type="text/javascript" src="/beta/js/yui/event.js"></script>

        <script type="text/javascript" src="/beta/js/yui/dom.js"></script>

        <script type="text/javascript" src="/beta/js/yui/dragdrop.js"></script>

        <script type="text/javascript" src="/beta/js/yui/animation.js"></script>

        <script type="text/javascript" src="/beta/js/yui/tabview.js"></script>

        <script type="text/javascript" src="/beta/js/yui/container.js"></script>

        <script type="text/javascript">

        var YAHOO=window.YAHOO||{};

        YAHOO.namespace=function(_1){

                if(!_1||!_1.length){

                        return null;

                }

                var _2=_1.split(".");

                var _3=YAHOO;

                for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){

                        _3[_2[i]]=_3[_2[i]]||{};

                        _3=_3[_2[i]];

                }

        return _3;

        };

        YAHOO.namespace("util");

        YAHOO.namespace("widget");

        YAHOO.namespace("example");

         

        var YMAPPID = "myAppId";

        </script>

        <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/map/js/api/ymapapi_3_0_4_7.js"></script>

         

        Here was my original setup:

         

        <script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=myAppId"></script>

        <script type="text/javascript" src="js/maps.js"></script>

        <script type="text/javascript" src="/beta/js/yui/yahoo.js"></script>

        <script type="text/javascript" src="/beta/js/yui/event.js"></script>

        <script type="text/javascript" src="/beta/js/yui/dom.js"></script>

        <script type="text/javascript" src="/beta/js/yui/dragdrop.js"></script>

        <script type="text/javascript" src="/beta/js/yui/animation.js"></script>

        <script type="text/javascript" src="/beta/js/yui/tabview.js"></script>

        <script type="text/javascript" src="/beta/js/yui/container.js"></script>

         

        I tried taking every combination that I can think of regarding including the files in different orders.  If someone sees something I have missed, please let me know, although my solution is working fine.  I basically just skipped loading the YMap versions of event, dom, animation and dragdrop.

         

        Thanks,

        Sherman

         

         

         


        From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Ken Robinson
        Sent: Thursday, November 30, 2006 4:10 PM
        To: ydn-javascript@yahoogroups.com
        Subject: Re: [ydn-javascript] Issue using YMaps and YUI Tabview together

         

        At 03:45 PM 11/30/2006, orbit517 wrote:

        >I'm trying to build a page using YMap and Tabview together and when I
        >have the source file for the map, I get a javascript error and the
        >tabview is not rendered.
        >
        >The javascript error is:
        >
        >YAHOO.util. Event.OnContentR eady is not a function
        >
        >When I remove the YMap source file, the tabview works and I don't get
        >the above javascript error.

        Make sure you include the Yahoo Maps Javascript before the YUI
        Javascript. I had a similar problem when I was including the Maps
        Javascript after the YUI.

        Ken

      Your message has been successfully submitted and would be delivered to recipients shortly.