我正在尝试<div><ul><li>
使用 .append 方法添加。一点运气都没有!
<div data-role="page" data-theme="b" id="calendar" data-add-back-btn="true">
<div data-role="content" data-theme="b" id="myBlank">
<!-- CONTENT -->
</div>
<div data-role="header">
<h1>-CALENDAR-</h1>
<a class="ui-btn-right" id="infoButton" onclick="getMyCalendar();">Refresh</a>
</div><!-- /header -->
<div data-role="content" data-theme="b" id="calToday">
<!-- CONTENT -->
</div>
<div data-role="footer">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div>
问题出在以下?
$('#calendar').append('<div data-role="content" id="month"><ul data-role="listview"><li>HI</li></ul></div>');
更新:这是我的代码,问题是在哪里再次初始化页面,因为它是在页面加载之前填充的:
$.post(jaction, { device: "stdbrowser", action: "doLogin", j_username: xuser, j_password: xpwd, j_accessCode: xcode, j_host: jaction }, function(data) {
var jsessionid = sessionStorage.jsid;
var prefix = sessionStorage.jsid_prefix;
var doAction = "https://" + prefix + ".domain.net/servlet/ServletController;jsessionid=" + jsessionid + "?action=" + action;
$.get(doAction, function(data) {
var iDivFormat = formatCalendar(data);
$('#calendar').append('<div data-role="content" id="month"><ul data-role="listview"><li>HI</li></ul></div>').children().last().trigger("create");
$('#month').html(iDivFormat).trigger("pagecreate");;
$('#calendar #progress').remove();