While using iframe, tapping a button causes scrolling to page top involuntarily

While using iframe, tapping a button causes scrolling to page top involuntarily

Hello all,


iphone4(ios4.31). Tapping a button causes scrolling to page top involuntarily.

This is how the trouble occurs;
Kill Safari process.
Run Safari, open frame.html and tap [move pageB].
Scroll down and tap [move pageA].
Then you'd be jumped to page top and the [move pageA] button doesn't work anymore.

Page reboot can resolve this trouble sometimes.
After killing and rerunning Safari process, you'll face it in high ratio.

I am in deep trouble and begging for your kindness!


frame.html
  1. <html>
  2. <head>
  3.  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"> 
  4.  <meta name="format-detection" content="telephone=no" />
  5.  <style type="text/css"> 
  6.   html,body {
  7.    margin: 0;
  8.    padding: 0;
  9.   }
  10.  </style>
  11.  <title>frame</title>
  12. </head>
  13. <body>
  14. <iframe id="frame1" src="main.html" style="width: 100%; height: 400px; display: block; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "></iframe>

  15. </body>
  16. </html>

main.html
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  <meta charset="utf-8"> 
  5.  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
  6.  <title>main</title> 
  7.  <link rel="stylesheet"  href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" /> 
  8.  <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script> 
  9.  <script type="text/javascript"> 
  10.  $(document).bind("mobileinit", function(){
  11.   $.extend(  $.mobile , {
  12.     ajaxFormsEnabled: false,
  13.   });
  14.  });
  15.  </script>
  16.  <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>

  17. </head>
  18. <body>
  19.  <div data-role="page" id="A">
  20.   <div data-role="content">
  21.    <form action="main.html#B" method="post"> 
  22.     page A
  23.     <button id="movePageB" type="submit">move pageB</button>
  24.    </form>
  25.   
  26.   </div>
  27.  </div>

  28.  <div data-role="page" id="B">
  29.   <div data-role="content">
  30.    page B top
  31.    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
  32.    <form action="main.html#A" method="post"> 
  33.     <button id="movePageA" type="submit">move pageA</button>
  34.    </form>
  35.   </div>
  36.  </div>

  37. </body>
  38. </html>