Tuesday, April 13, 2010

Solution for _WidgetManager undefined error

I started using a script that shows me what javascript errors occur in my blog. I soon found out that there were about 10-20 errors each day, intermittently, the vast majority of them being '_WidgetManager is undefined'. I googled it, of course, only to discover that a lot of people had it, some fix was applied by Google and thus most of the articles on the web were completely unuseful.

Well, what seemed to happen is that some code was added at the end of the blog page, loading a js file, and if the js file was (for some weird reason) not loaded, the script following would throw an error. So I added my own script to create a fake _WidgetManager class just in case the script did not load.

Hoping it might help others, here is the script:
_Init:function() {},
_SetPageActionUrl:function() {},
_SetDataContext:function() {},
_SetSystemMarkup:function() {},
_RegisterWidget:function() {}


Ocean Ban said...

great,it help me so much