我在使用jquery mobile编码的英特尔XDK中运行一个简单示例时遇到了一些问题。按钮不起作用,我找不到原因。 我发布了完整的代码但是是一个按钮和一个查询选择器来打开警报并在控制台中写入。 请帮忙吗?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="jqm/jquery.mobile-min.css">
<link rel="stylesheet" type="text/css" href="css/humedad_main.less.css" class="main-less">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script src="intelxdk.js"></script>
<script src="cordova.js"></script>
<script src="xhr.js"></script>
<script src="xdk/init-dev.js"></script>
<script type="application/javascript" src="lib/jquery.min.js"></script>
<script type="application/javascript" src="jqm/jquery.mobile-min.js" data-ver="0"></script>
<script>
$(document).on("pagecreate","#mainpage",function(){
$('#boton2').bind('click', function(){
console.log('pagina cargada');
alert('me tiene hasta los huevos');
});
});
</script>
</head>
<body>
<div class="upage" id="mainpage" data-role="page">
<div class="upage-outer">
<div data-role="header" class="container-group inner-element uib_w_1" data-uib="jquery_mobile/header" data-ver="0">
<h1>HUMEDAD</h1>
<div class="widget-container wrapping-col single-centered"></div>
<div class="widget-container content-area horiz-area wrapping-col left"></div>
<div class="widget-container content-area horiz-area wrapping-col right"></div>
</div>
<div class="upage-content content-area vertical-col left" id="page_59_24">
<button id="boton2">grafica 2</button>
</div>
</div>
</div>
</body>
</html>