Add buttons to header via Javascript
Description
The following code shows how to add buttons to header via Javascript.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!--from w ww. j ava 2 s .c o m-->
$('#ctrl').html('<a href="#" data-role="button" data-icon="bars" data-iconpos="notext" id="open-panel"></a><a href="#" data-role="button" data-icon="bars" data-iconpos="notext" id="open-panel2"></a>');
$('#ctrl').controlgroup({
type: "horizontal",
corners: false
});
$("#frontPage").trigger('create');
});//]]>
</script>
</head>
<body>
<div data-role="page" data-add-back-btn="true" id="frontPage">
<div data-role="header" data-theme="b">
<h3 id="heading">test</h3>
<div id="ctrl" class="ui-btn-right"></div>
</div>
</div>
</body>
</html>