Odd popup close behaviour.

Odd popup close behaviour.

So immediately on my startpage i fire off a popup like this:

  1. $( '#startpage' ).live( 'pageshow',function()
  2.     $("#mypopup").popup("open");
  3. });

Looks nice overlaying the startpage. But when i close it, it doesn´t go back to the page it is overlaying. It goes back one more page exiting my web root. Why is this happening? I´m using the following html code:

  1. <body>
  2.         <div data-role="page" id="startpage">
  3.             <div data-role="popup" id="mypopup" data-theme="b" data-overlay-theme="a" data-shadow="false" style="min-width:230px;">
  4.                 <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</a>
  5.                 </div>
  6. ...