Button in controlgroup not redirecting as expected - jQuery mobile
Below code does not seem to be redirecting properly. The code is in a html file named options.html and when I click "Quiz" the URL that is navigated to is /options.html#results.jsp. Should the redirect URL not be /results.jsp instead ?
<!DOCTYPE html>
<html>
<head>
<title>Options</title>
<link rel="stylesheet" type="text/css" href="jquery.mobile-1.0a4.1.css" />
<script type="text/jav开发者_JS百科ascript" src="jquery-1.6.1.js"></script>
<script type="text/javascript" src="jquery.mobile-1.0a4.1.js"></script>
<script type="text/javascript" src="jquery.mobile-1.0a4.1.js"></script>
</head>
<body>
<!-- Page starts here -->
<div data-role="page" data-theme="b" id="page1">
<div data-role="header" id="hdrMain" name="hdrMain" data-nobackbtn="true">
<h1>Options</h1>
</div>
<center>
<div data-role="content" id="contentMain" name="contentMain">
<form id="form1">
<div data-role="controlgroup">
<a href="results.jsp" data-role="button" >Quiz</a>
<a href="index.html" data-role="button" >No</a>
<a href="index.html" data-role="button" >Maybe</a>
</div>
</div><!-- contentMain -->
</center>
</div> <!-- page1 -->
<!-- Page ends here -->
</body>
</html>
If you don't want to use AJAX navigation, use any of the following attributes on the a-tag
- rel=external
- target (with any value, such as "_blank")
See http://jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-navmodel.html
In case you need a more in-depth look at navigation in jQuery Mobile, check out this helpful guide
http://jqx.ca/nav/
That is how jQuery Mobile works. If the browser is capable of AJAX then all requests are fetched with ajax and managed by jQuery Mobile.
Please read the first few chapters of the documentation.
精彩评论