jQuery Mobile $ .mobile.navigate

in jquerymobile i'm trying to implement an ajax based navigation and use $.mobile.navigate for history back and forward.

the funny thing is that it seems to be working (loading content and moving in history) but i get an error in console and a loading icon that stays on top of all pages

note: this happens only when i use regular url if i try with hash there is no problem

this is the error i get in console: "Uncaught ReferenceError: BrowserDetect is not defined"

i tried to google this error but there where no resault

this is my code:

(where myloadPage is an ajax .load function)

$( window ).on( "navigate", function( event, data ) {
  event.preventDefault();
  var direct =  data.state.direction;
  var linkedPage = data.state.url;
 if(linkedPage){ myloadPage(linkedPage)};

});


var hijack = function(){
    // retreive linked page
    var linkedPage = $(this).find('a').attr('href');

    $(this).click(function() {
        myloadPage(linkedPage);
        $.mobile.navigate( linkedPage, { foo: linkedPage });
    });

};