2

I have a short question to JQuery mobile

I Have the following script and want to have a data transition=slide but it is not working with window.location.href. So i want to change it to $.mobile.changePage. But I don't get it.

Here is the script;

var category_data;
$(document).ready(function () {
    $('#search_category_form').bind('submit', function(){
        var form = $('#search_category_form');
        var data = form.serialize();

        $.post('index.html', data, function(){
            category_data = data; 
            window.location.href = 'index.html#search_general';
        });

        return false;
    });        

Thank you for your help

user3791330
  • 33
  • 1
  • 3

1 Answers1

2

$.mobile.changePage() is now deprecated, however you can change your code to:

// [deprecated] $.mobile.changePage("index.html#search_general", {transition: "slide"});
$.mobile.pageContainer.pagecontainer("change", "index.html#search_general", {transition: "slide"});
Sga
  • 3,608
  • 2
  • 36
  • 47