我想在 pageint 上动态附加正文数据。数据被附加到正文,但它是隐藏的。
这是js代码。
$(document).on('pageinit', "#feedback-form", function(){
var html = "<div data-role='page' id='feedback-page1'><div data-role='header' data-position='fixed' data-theme='a' data-id='feedback-header'><div class='header'></div><div class='navbar'></div><div class='logo-div leftfloat padding20'><img src='images/logo.jpg' alt='Sodexo Logo' border='0'></div><div class='nav-bg'>Speak to us</div></div><div data-role='content'><div class='bodymargin"><form><ul data-role='listview' data-inset='true'><li data-role='list-divider'><div class='font22'>» How Satisfied are you with the product? </div><div class='leftfloat feedback-smile-div'><div class='align-center smile'><a href='#feedback-page2' data-transition='slideup'><img src='images/very-dissatisfied.png' alt='Very Dissatisfied' border='0' class='answer'></a></div><div class='clear'></div><div class='align-center smile-lable'><img src='images/smile-lable4.png' alt'' border='0'></div></div></li></ul></div></li></ul></div></form></div> <!-- body margin div --></div> <!-- content div ends here --><div data-role='footer' data-theme='a' data-id='feedback-footer' data-position='fixed'><p class='text-center'><small> © Copyright 2013All Rights Reserved</small></p><a href='#gotoactivate' data-icon='home' data-iconpos='notext' data-rel='dialog' class='ui-btn-left'> Home </a><a href='#gotoindex' data-icon='delete' data-iconpos='notext' data-rel='dialog' class='ui-btn-right'> Logout </a></div> <!-- footer div ends here -->"
$("body").html(html);
});
Html Code
<body id="feedback-form">
</body>