0 Replies - 1848 Views - Last Post: 26 June 2014 - 05:16 AM

#1 mutago234   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 260
  • Joined: 08-September 13

anchor link not working in jquery mobile and ajax

Posted 26 June 2014 - 05:16 AM

i created an ajax form page in jquery mobile but when a click on a link that will take me to the ajax page, it does not link well. it seems that jquery mobile uses the "#" sign to name pages.

example, when a click on link
<a href="http://localhost/data/insert_ajax.html">form page</a>

i will end up having this links in my browser

and as such, the page will not load.

i have used data-ajax="false" or rel="external" it works by reloading the page and that is not what i want.

I want the page to be linked normally and so i tried to eliminate "#" sign as in the code below but i cannot get it work.

 $('body').on('click', '.homeSet', function(ev) {
   // $.mobile.changePage('http://localhost/data/#/data/insert_ajax.html', {
$.mobile.changePage('http://localhost/data/insert_ajax.html', {
        transition : "slide"
    return false;



in the body of form i have this

<a href="#" class='homeSet'>ajax_form</a>

any help please.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1