0

これは私のindex.htmlページです

<!DOCTYPE html>
<html>
<head>

 <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
 <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>

  <title>PhoneGap WP7</title>

     <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"/>

      <script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>

     <script src="js/jquery.js"></script>
    <script src="js/jquery.selectBox.js"></script>
    <script src="js/jquery.selectBox.min.js"></script>

   <script src="js/new.js"></script>
   <script>
       function come()
      {
          navigator.notification.alert("not coming");

          $("#new").html("hello");
         $("#need").load("new.html", function(){
        navigator.notification.alert("Done!");
        });

     }

   </script>
 </head>
 <body>
     <h1>Hello PhoneGap</h1>

     <div id="new">asdsd</div>
    <div id="hello">It is want to gone</div>
    <div id="need"></div>

   <input type="button" value="here" onclick="come()" />
 </body>
</html>


**My new.html page is**

 <html>
 <body>
 <h2>New one</h2>
 <p id="hello">Why it is not coming to here is it any problem<p>
 </body>
  </html>

ここでは、このnew.htmlをindex.htmlのニーズIDにロードしたいのですが、ロード機能が機能せず、上記の方法で試しました。ロード機能にアラートボックスが表示されていますが、new.htmlのコンテンツが表示されていません。 WindowsPhoneで。私は正確な問題が何であるかを理解していませんでした。私の疑問は、phonegapでWindows Phoneがload()関数をサポートしていることです。だから、何か提案をしてください。

4

1 に答える 1

0

"oの後にがありません$("#hello)

jquery 行を.ready()メソッド内にラップしてみてください。

$(document).ready(function() {
    $("#new").html("hello world");
    $("#hello").load("new.html");
});
于 2012-11-08T04:59:29.840 に答える