Jquery mobile - does not load my main.js after the change page

Asked

Viewed 241 times

0

I built a page using jquery mobile with the function of all buttons in a main.js file Divs that when clicked I check in js and do ex action:

$( "#mais-op" ).on( "tap", function() {
  $.mobile.changePage( "2.html", { transition: "pop"} );
});

Everything works normal until I change page to another page. When I’m on the other page on tap does not happen as if I hadn’t loaded main.js. But if I do Reload on the page everything will work again

How do I fix this? Thank you

  • Does this changePage method pull a page into the current page? If yes the method does Reload the jquery components?

  • She calls an outside page and carries it. If you have an Alert for example inside the delegate pagecreate that checks whether the 2.html page has been loaded it works. But nothing else works (click, tap event) until you reload the page

  • Sorry, it was silly I was using ids on some elements instead of the correct way to use classes. Then as everything is loaded on the same page, an element with the same id on another page does not work, but no errors are generated in the console. So I couldn’t figure out what the problem was. Only after I figured out what the fuck I was doing. Thanks anyway

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.