0

This is the HTML I'm trying to bind to. I would like to know how to bind the result of menuInnerHtml to the navigationMenu div. Right now the output is: [object Object][object Object][object Object][object Object][object Object][object Object] instead of the actual html.

<div id="navigationMenu" data-bind="html: get_Menu()"></div>

var menuInnerHtml = $();
var GlobalNavMenuViewModel = {

        get_Menu : function () {
            for (var i = 0; i < 10; i++) {
                if(i % 2 == 0 )
                {
                    menuInnerHtml += $("<li></li>").attr('class', 'L1').html("someInfo");
                }
            }
            return menuInnerHtml;
        }
    }

    // Bind Html
    ko.applyBindings(GlobalNavMenuViewModel);
Kevon
  • 43
  • 7
  • I did .html() and it yielded nothing. – Kevon Dec 28 '13 at 00:22
  • As far as the "knockout way" my actual if structure for binding kinda complex so I'd like to just bind html I generate – Kevon Dec 28 '13 at 00:40