Search code examples
androidjquery-mobilecordovamultipage

javascript not working in phonegap while navigating pages


I am making one application for android with jquery mobile and phonegap which contains 10 different html pages. All the pages works fine in browser . But java script is not working while navigating to some pages in following way .

  • index >> page 1 >> page 5 .... not working
  • index >> page 1 >> page 2 >> page 3 >> page 4 >> page 5 ... not working
  • index >> page 5 .... working

what should be the reason for javascript not working ? I am navigating pages using href attribute of anchor tag.

code for not working :

<a data-role="button" href="../friends/friends.html" data-icon="6_social_group" data-iconpos="top" data-theme="f" data-mini="false">Friends</a>

Code For working :

<a href="content/friends/friends.html">Friends</a>

Solution

  • I had the same issue but adding the following code made it work for me. Add the property

    rel="external"

    <a href="pagename.html" rel="external" data-role="button">Click Me</a>

    I hope it helps you too