0
jQuery mobile.i를 사용하여 웹 페이지를 만들고 있습니다.이 기술에 익숙하지 않습니다. 목록 항목 클릭으로 다른 페이지로 이동하고 싶습니다. 두 번째 페이지로가는 동안 나는 그것을 표시하기 위해 목록 항목과 목록 항목 ID에서 텍스트 값을 전달하려고합니다. 누군가 나를 안내 할 수 있습니까?목록 항목 및 데이터 전송
내 HTML 코드는 다음과 같습니다
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Demo Page</title>
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css"/>
function onDeviceReady() {}
document.addEventListener("deviceready", onDeviceReady, false);
function Button_onclick() {
for(i=0; i < 3; i++){
$("#numbers").append('<li id="'+i+'" ><a href="#page2#">' +i+'</a></li>');
$('#numbers').listview('refresh');
}
}
</script>
</head>
<body>
<div >
<input id="Click_Button" type="button" value="Submit" onclick="Button_onclick()" />
</div>
<div id="divList" data-role="content">
<ul id="numbers" data-role="listview" data-inset="true"> </ul>
</div>
</div>
<div data-role="page" id="page2">
<div data-role="header">
<h1>Page Two</h1>
</div>
<div data-role="content">
<p>Welcome to page 2.</p>
</div>
</div>
</body>
</html>
당신은 http://stackoverflow.com/questions/10671092/passing 여기에 값을 전달에 대한 자세한 내용을보실 수 있습니다 -data-between-pages-with-jquery-mobile – Taifun