0

I have a web app that I contains links to several pages. I am using jQuery Mobile framework. However, when I click a link, it opens the page in Safari and not in the web app.

Here is my javascript code that I link to in the page with the links:

$( document ).on (
"click",
"a",
function( event ) {
    event.preventDefault();

    location.href = $( event.target ).attr ( "href" );
}
);

Is it outdated now or am I missing something?

Khan
  • 33
  • 6

1 Answers1

0
$(document).delegate("a", "vclick click", function(event) {
  $.mobile.defaultPageTransition = "slide";                
   var href = $(this).attr("href");
   event.preventDefault();
   if ( event === "click" ) { return; }                      
   $.mobile.changePage(href);
});
Ved
  • 2,701
  • 2
  • 22
  • 30