My UI application is utilizing requireJs and knockout js.
In the main html file (index.html), there is a div element as follows:
<html style="height:100%" lang="en">
<head>
<title>Main</title>
<script data-main="myMain" src="/path/js/libs/require/require.js" type="text/javascript"></script>
</head>
<body style="background-color:#EDEDED">
<div class="someClass" id="loading" data-bind="text:loading"></div>
</body>
</html>
The binding to a "Loading" text is done in myMain.js file with the following code:
ko.applyBindings({loading: getTranslatedStringFromLib('LOADING')}, $('#loading')[0]);
Although it usually works well, sometimes knockout inserts [object HTMLDivElement]
, resulting in the generated code appearing like this:
<div data-bind="text:loading" class="someClass" id="loading">[object HTMLDivElement]</div>
Has anyone encountered a similar issue before? Any insights on what might be causing this behavior?