General developer forum

 
 
Picture of Andrew Nicols
Re: Block/YUI help please
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Michael,

I think that what you're doing *should* be working, but I guess something isn't quite right, most likely with the way that you're calling js_init_call. I would imagine that the reason you're not seeing any errors in the firebug is that it's not being included for some reason. Are you seeing any references to M.block_foobar in the page source? You shoudl at least see a call to your init function. If you're not, then I would imagine that you're somehow not calling the js_init_call at all.

You don't say what version of Moodle you're developing for, but I'd really recommend reading the latest version of the JS documentation, specifically the YUI Module documentation at http://docs.moodle.org/dev/YUI/Modules. Although it's still a work in progress (sorry - I will get around to finishing them soon) they should give you a point in the right direction to how we're pushing JS in Moodle now.

Best wishes,

Andrew

 
Average of ratings: -
Picture of Andrew Nicols
Re: Block/YUI help please
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Oh, and in your config.php, set $CFG->jsrev = -1; to ensure that you aren't caching within Moodle, and disable your browser cache in the browser's developer tools.

 
Average of ratings: -