Hitting a critical issue with WP7 using the changePage method.
Here is my setup:
in the head tag
- <script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
- <script type="text/javascript" src="js/custom.js"></script>
- <script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
step2.html which has this link to square_rectangle.html
- <li><a href="square_rectangle.html"><img src="img/square.png" /><strong>Square/Rectangle</strong> For footings, slabs and flooring</a></li>
works fine.
on square_rectangle.html, the inital markup is this
- <div data-role="page" id="three">
on the page is a form which has items that need to be calculated, there is a function in the custom.js file to this.
on the page is a anchor link which links has an empty href value
- <a id="calculate_square" href="#" name="calculate_btn">Calculate volume</a>
and here is the js, which works in everything except WP7/IE7
- $('#three').live('pagebeforeshow',function(event, ui){
- $('#calculate_square').click(function(evt) {
- var height = $('#height').val();
- var width = $('#width').val();
- var depth = $('#depth').val();
-
- if(height == 0 || width == 0 || depth == 0){
- alert("something is blank");
- }
- else {
- evt.preventDefault();
- calculateSquare();
- $.mobile.changePage("results.html", "slide", false, true);
- //$.mobile.path.set("results.html")
- /*
- $.mobile.changePage({
- url: 'results.html',
- type: 'post',
- data: $('form#frmCalc').serialize()
- },'slide',false,false);
- */
-
- }
- });
- });
on WP7, if I leave the form fields empty, I get the alert(). However, the changePage function just isn't firing. Sometimes I get this error in IE7 "