I'm writing Android app (single page application), using Visual Studio tools for Cordova and Ratchet bootstrap. After injecting new HTML into page, my </div>
tag mysteriously transformed to </button>
, and markup crashed.
Example of injected HTML:
<div class="content">
<button class="btn btn-negative btn-block" onclick="Logout();>Logout</button>
<div class="heartbeat"></div>
</div>
Injecting code:
$('body').html(finalHtml);
$('#heartbeat').html('');
What it turned to:
<div class="content">
<button class="btn btn-negative btn-block" onclick="Logout();>Logout</button>
<div class=" heartbeat"=""></button>
</div>
Where should I seek a reason? It's a Ratchet bug? Or Cordova? I'm completely out of mind :(
onclick="Logout();
you are missing " there at least. After that it seems to work correctly at least on JSFiddle.