Latest Posts »
Latest Comments »
Popular Stuff (get plugin

Yahoo Maps Error: YAHOO.util.CustomEvent is not a constructor

Written by Vlad on May 28, 2008 – 4:21 pm

UPDATE: Fixed by Yahoo!

Seems like someone messed up! Yahoo Maps’ AJAX API is broken and Firebug prints this lovely message:

YAHOO.util.CustomEvent is not a constructor

A quick workaround is to grab the output from”

http://api.maps.yahoo.com/ajaxymap?v=(version)&appid=(apikey)

and look for

http://in.maps.yahoo.com/js

Replace that with:

http://in.maps.yahoo.com/v(version)/aj

Then replace your call to the AJAX API:

<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=(version)&appid=(apikey)"></script>

with the modified output from that 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 = "(apikey)";
function _ywjs(inc) { var o='<'+'script src="'+inc+'"'+' type="text/javascript"><'+'/script>'; document.write(o); }
_ywjs('http://in.maps.yahoo.com/v(version)/aj/y.js');
_ywjs('http://in.maps.yahoo.com/v(version)/aj/ymapapi.js?v=(full_version)');
_ywjs('http://in.maps.yahoo.com/v(version)/aj/ymic_4.js');
</script>

This is a temporary workaround, YAHOO! will probably fix this really soon!

PS: Remember to replace (apikey), (version) and (full_version) with the proper  values!


Tags: , , ,
Posted in programming | 5 Comments »

Running on Mojito Software