显示背景页面而不刷新页面

时间:2016-04-29 12:19:32

标签: jquery html

我遇到问题,就是当我向HTML页面插入背景时,背景不会出现。应刷新页面以显示背景。我对这个问题一无所知,这是我的代码:

<!DOCTYPE >
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="jquery.mobile-1.4.5.css">
        <script src="jquery-1.12.0.min.js"></script>
        <script src="jquery.mobile-1.4.5.min.js"></script>

        <script>
        $("document").ready(function(){
           $("#page6").css("background-image","url('http://up.arabseyes.com/uploads2013/29_04_16146193093279651.jpg')");
        });
    </script>
    </head>
    <body>

        <div id = "page6" data-role="page">
            <div id="header" >
                <center>
        <h1>Contact</h1>
                </center>
            </div>
                <div data-role= "contenet">

<FORM action="mailto:youremail@hotmai.com" method="post" enctype="text/plain">
                        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="90%">
                            <TR>
                                <TD width="30%">
                                <DIV align="right">
                                    <B>Name:</B>
                                </DIV></TD>
                                <TD width="70%">
                                <INPUT type="text" name="name" size="20">
                                </TD>
                            </TR>
                            <TR>
                                <TD>
                                <DIV align="right">
                                    <B>Email:</B>
                                </DIV></TD>
                                <TD>
                                <INPUT type="text" name="email" size="20">
                                </TD>
                            </TR>
                            <TR>
                                <TD>
                                <DIV align="right">
                                    <B>Message:</B>
                                </DIV></TD>
                                <TD>                                <TEXTAREA name="comment" cols="30" wrap="virtual" rows="4">
</TEXTAREA></TD>
                            </TR>
                            <TR>
                                <TD>&nbsp;</TD>
                                <TD>
                                <INPUT type="submit" name="submit" value="Submit">
                                <INPUT type="reset" name="reset" value="Reset">
                                </TD>
                            </TR>
                        </TABLE>
                    </FORM>

                    <div data-role="footer" data-theme="a" data-content-theme="b">

                        <div data-role="navbar">
                            <ul>
                                <li>
                                    <a href="page2.html" data-icon="home" >Home</a>
                                </li>

                                <li>
                                    <a href="page3.html" data-icon="heart" >BMI</a>

                                </li>
                                <li>

                                    <a href="#page4" data-icon="user" >Records</a>

                                </li>
                                <li>
                                    <a href="#page5" data-icon="bars" >Suggestions</a>

                                </li>

                                <li>

                                    <a href="#page6" data-icon="mail" >Contact</a>
                                </li>
                            </ul>
                        </div>

                    </div>

                </div>

        </div>

    </body>

</html>

0 个答案:

没有答案