2
jQuery-mobile로드 페이지를 가져 오는 중에 "content
"div
에로드하는 데 문제가 있습니다.jquery mobile - loadPage 문제
나는 내 페이지를 기본으로 자르고 여기에 코드가있다. 나는 당신이 다른 페이지 내에서 페이지를로드 할 수 있다고 생각하지 않습니다
index.html:
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JQuery Mobile Load Page Test</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page">
<div id="containerTest" data-role="content">
<input type="button" id="nextPage" data-inline="true" value="Load Second Page"/>
</div> <!-- /content -->
</div> <!-- /page -->
<script>
$("#nextPage").on("click", function()
{
$.mobile.loadPage("nextPage.html",
{
pageContainer: $('#containerTest')
});
});
</script>
</body>
</html>
및
<div data-role="page">
<p>this is the next page</p>
</div> <!-- /page -->
다소 있지만 내용이 내 div에로드되지 않습니다 < div id = "containerTest"data-role = "content">, 전체 페이지를 nextPage.html로 변경합니다. – user2158259
@ user2158259 컨테이너 내용을 바꾸거나 추가 하시겠습니까? –
컨테이너 내용을 바꿉니다. – user2158259