Search code examples
javascriptbackbone.jsmarionette

Marionette examples not working in jsfiddle


I want to learn Marionette regions and layouts with some examples in jsfiddle, but every example I look at seems non-functional or completely blank.

For instance I just see a completely black output for the first example in the answer from this question: Example of marionette.js layout/region structure and rendering method

In the jsfiddle of this Nesting Marionette regions, layouts and views answer I just see:

Navigate

Content

I've tried multiple browsers and different computers but I see the same thing. Is there something I'm doing wrong? Do you have any examples I could look at?


Solution

  • You should use a CDN, like https://cdnjs.com/ to load scripts on jsfiddle. I've forked that two examples that you sent

    http://jsfiddle.net/tegon/64ovLf64/

    http://jsfiddle.net/tegon/0g2aaLxe/

    I've also changed the Backbone.Marionette.Layout to Backbone.Marionette.LayoutView (new class name).

    Edit: The second was using region.close() which is deprecated. I've changed now to use region.empty()

    http://jsfiddle.net/tegon/0g2aaLxe/1/