[Solved] jquery mobile popup leads to different page on close

[Solved] jquery mobile popup leads to different page on close

Hello everybody,
I am new to jquery mobile and I have following problem:
I have 2 pages in two different html files - root page and settings page - in my root page i display popup, but when I close popup by escape or clicking outside popup I am redirected to settings page. 
Could anyone please tell me what am I doing wrong? 
EDIT:
After some digging inside jquery js I have found out solution - I have to set history option of popup to false and then it closes normaly.
Here is code of my root page:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5.   <meta name="viewport" content="width=device-width, initial-scale=1"> 
  6.   <title>Root page</title>  
  7.   <link rel="stylesheet" href="css/jquery.mobile-1.2.0.css" />
  8.   <link rel="stylesheet" href="css/rieter-mobile.css"/>
  9.   <link rel="stylesheet" href="css/my.css"/>
  10.   <script type="text/javascript" src="js/jquery-1.8.2.js"></script>        
  11.   <script type="text/javascript" src="js/jquery.mobile-1.2.0.js"></script>
  12.   <script type="text/javascript" src="js/jquery.tmpl.js"></script>  
  13.   <script type="text/javascript" src="js/my.js"></script>
  14. </head>
  15. <body>
  16. <script type="text/javascript">
  17. function checkWebSocket(){
  18. $("#popupDiv").popup();
  19. if ("WebSocket" in window){
  20. $("#popupDiv p").text("Websockets are supported.");
  21. }else{
  22. $("#popupDiv p").text("Websockets are not supported.")
  23. }
  24. $("#popupDiv").popup("open")
  25. }

  26. $(function(){
  27. checkWebSocket();
  28. })
  29. </script> 
  30. <div id="root_page" data-role="page">
  31. <div id="header" data-role="header" data-position="fixed" data-theme="b">
  32. </script>
  33. <h1>Root page</h1>
  34. <div data-role="navbar">
  35. <ul>
  36. <li><a href="/" class="ui-btn-active ui-state-persist" data-prefetch>Home</a></li>
  37. <li><a href="/settings" data-prefetch>Settings</a></li>
  38. </ul>
  39. </div>
  40. </div>
  41. <div id="popupDiv">
  42. <p></p>
  43. </div> 
  44. <div id="footer" data-role="footer" data-position="fixed" data-theme="b">
  45. <h3>2012 &copy; Foo</h3>
  46. </div>
  47. </div>
  48. </body>
  49. </html>