mutago
06-26-2014, 12:16 PM
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
http://localhost/data/#/data/insert_ajax.html
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.
<script>
$('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;
});
</script>
in the body of form i have this
<a href="#" class='homeSet'>ajax_form</a>
any help please.
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
http://localhost/data/#/data/insert_ajax.html
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.
<script>
$('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;
});
</script>
in the body of form i have this
<a href="#" class='homeSet'>ajax_form</a>
any help please.