Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Can't reload same page using pagecontainer and reload paremeter #7406

Closed
@Gajotres

Description

@Gajotres

Lets say I am working with one HTML file, lets name it index.html.

If I want to reload that page using this code:

$.mobile.pageContainer.pagecontainer( "change", "index.html", { reload: true} );

Nothing happens, but if I do it using this code:

$.mobile.pageContainer.pagecontainer( "change", "index.html", { reloadPage: true} );

Everything works just fine.

My problem is reloadPage works correctly (unfortunately its deprecated), while reload does nothing, at least nothing expected.

I made a working example, in it, I am changing header title before reload process, this way I can see if page was reloaded successfully.

Example:

<!DOCTYPE html>
<html>
    <head>
        <title>jQM Complex Demo 1</title>
        <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" /> 
        <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>    
        <script>
            $(document).on('pageinit', '#index', function(){ 
                $(document).on('click', '#changePage', function(){ 
                    $('.ui-title').html('MEH');
                    $.mobile.pageContainer.pagecontainer( "change", "index.html", { reload: true} );
                    //$.mobile.pageContainer.pagecontainer( "change", "index.html", { reloadPage: true} );
                });
            });
        </script>
    </head>
    <body>     
        <div data-role="page" id="index" data-theme="a" data-history="false">
            <div data-role="header">
                <h3>
                    First Page
                </h3>
                <a href="#second" class="ui-btn-right">Next</a>
            </div>

            <div data-role="content">
                <input type="button" value="Button" id="changePage">
            </div>

            <div data-role="footer" data-position="fixed">

            </div>
        </div> 
    </body>
</html>   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions