render() function not working in binders


I am trying to use mojit binders to bind a click event on a button. I want to render the same view with a conditional error message, but it seems the callback function is resulting in an error message: "Failed to load mojit for myMojit"

The callback function isn't doing anything excepting printing.

The render() function prototype (http://developer.yahoo.com/cocktails/mojito/api/classes/MojitProxy.html#method_render) is used as follows in the application:

this.mojitProxy.render({error: 'My error msg'}, 'index.hb.html', function(err, str) { if (err) { alert('err: ' + err); } else { alert('success'); });

I have the following questions: 1. What seems incorrect in the above snippet? 2. What is the role of the callback function in the render function? 3. Is it necessary to pass some data always?

Thanks for the help in advance!

0 Replies

Recent Posts

in Yahoo! Mojito