2

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?

Community
  • 1
  • 1
dustydojo
  • 449
  • 5
  • 14
  • just some "external resources" loading issues caused by using raw.github ... just link marionette properly and everything will work. (read more https://rawgit.com/faq) – rafaelcastrocouto Oct 28 '15 at 13:37
  • What can I do to link marionette properly? I didn't see the answer in the FAQ. – dustydojo Oct 28 '15 at 13:51

1 Answers1

4

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/

tegon
  • 538
  • 4
  • 12
  • The one that was black now seems to work except the Toggle Sidebar button. I'm not sure the other one works, as it just shows: This is nav-template This is breadcrumbs-template This is options-template This is content-template – dustydojo Oct 28 '15 at 14:04
  • The first one is correctly, it only replaces the content with the templates. I've updated the answer with second one working now. – tegon Oct 28 '15 at 16:51
  • 1
    I just updated all links in the mentioned questions to the working fiddles provided by @tegon ... gj – rafaelcastrocouto Oct 28 '15 at 18:56
  • Good one! Thanks @rafaelcastrocouto – tegon Oct 28 '15 at 19:40