How to: jQuery Mobile refresh button

Associate
Joined
22 Aug 2011
Posts
240
All I am trying to do is get my "refresh" button to simply refresh the page upon click, but my coding below is not allowing me to do so, I'm not sure why. Any help would be greatly appreciated.

<!DOCTYPE HTML>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<link href='style.css' rel='stylesheet'/>

<script>
function swapButton() {
var b = $('#button');
b.text('Done');
b.buttonMarkup({ icon: "check" });
b.button('refresh');
}
</script>

</head>
<body>

<div data-role="header" data-theme="a">
<a data-icon="refresh" data-iconpos="right" data-theme="c" id="button" onclick="swapButton()">Refresh</a>
<h1>&copy; 2013 | EHU</h1>
</div>
 
Back
Top Bottom