0

Since I have begun using jQuery Mobile 1.1.1 I have had trouble getting a form input button to redraw properly. Below is an example of what I have tried. But it only draws the input field like a text field and not a button.

test1.php

<!DOCTYPE html> 
<html> 
<head> 
    <title>Test</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="css/jquery.mobile-1.1.1.min.css" />
    <link rel="stylesheet" href="css/jquery.mobile.theme-1.1.1.min.css" />
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/jquery.mobile-1.1.1.min.js"></script>
    <script type="text/javascript">
        $("#test").live("pageshow",function(event, ui) {
            $("#ajax").load("test2.php", function() {
                $("#test").find('input,textarea').textinput();
            });
        });
    </script>
</head> 
<body> 

    <div id="test" data-role="page" >
        <div data-role="header">
            <h1>Test</h1>
        </div>
        <div data-role="content">
            <input id="button" type="button" value="Normal" data-theme="b"/>
            <div id="ajax"></div>
        </div>
    </div>

</body>
</html>

test2.php

<input id="button" type="button" value="Ajax" data-theme="b"/>
4

1 に答える 1

1

.trigger('create'); を使用します。このようなページで:

 $('#test').trigger('create');
于 2012-07-24T16:29:59.450 に答える