I have a dialog (not external html), which is displayed when I click on a button on the page, it works fine if the html containing the dialog is the first page to be accessed , but if that file is opened by clicking on an href from another page, the dialog doesn't show up when I click the button.

Here is the code for the page containing the dialog ... The alert in the click event of the button is showing up even when this is the not the first page to be accessed, but the dialog doesn't show up.

```
<!DOCTYPE html>
<html>
<head>
<title>Create Team</title>
<link rel="stylesheet"
    href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>

</head>
<body>

    <!-- Page starts here -->
    <div data-role="page" data-theme="b" id="page1">
        <div data-role="header" id="hdrMain" name="hdrMain"
            data-nobackbtn="true">
            <h1>Test screen</h1>
        </div>
        <div data-role="content" id="contentMain" name="contentMain">
            <div id="fullnamediv" data-role="fieldcontain">
                <label for="fullname" id="fullnameLabel" name="fullnameLabel">Team
                    Name*</label> <input id="fullname" name="fullname_r" type="text" />
            </div>
            <div id="submitDiv" data-role="fieldcontain">
                <a id="buttonSave" name="buttonSave" href="#" data-role="button"
                    data-inline="true">Save</a>
            </div>
        </div>
        <!-- contentMain -->
        <div data-role="footer" id="ftrMain" name="ftrMain"></div>
        <script>
            $("#page1").bind("pagecreate", function() {
                $('#buttonSave').click(function() {
                    alert("aaaa");
                $.mobile.changePage('#successdiv', {
                    transition: 'pop',
                    reverse: false,
                    changeHash: true
                });
                    alert("after change");
                    return true;
                });
            });
        </script>

    </div>
    <!-- page1 -->

    <div data-role="dialog" data-theme="a" id="successdiv">
        <div data-role="header" data-theme="f">
            <h1>Error</h1>
        </div>
        <div data-role="content">
            <p>This is Page 2</p>
            <button type="submit" data-theme="e" name="successok"
                value="submit-value" id="successbutton">Close Dialog</button>
        </div>
    </div>
    <!-- Page ends here -->
</body>

</html>    

```