ReferenceError:找不到变量:$

Ami*_*nai 0 javascript html5 cordova

嗨所有我正在开发一个游戏,当我在Chrome上运行它工作,但当我在模拟器上尝试它我在我的javascript代码中得到一个错误,我无法理解来源或原因

这是错误:

05-13 11:53:11.726: E/Web Console(790): ReferenceError: Can't find variable: $ at file:///android_asset/www/js/html5games.matchgame6.js:5
Run Code Online (Sandbox Code Playgroud)

错误在第5行:这是我的javascript文件内容:

  var matchingGame = {};
  ***var uiPlay1 = $("#gamePlay1");***  //////line 5
  var uiPlay2 = $("#gamePlay2");
  var uiIntro = $("#popup");
  var uiExit = $("#gameExit");
  var uiNextLevel = $("#gameNextLevel");
  var uigameQuit =$("#gameQuit");
 var uiPlay3 = $("#gamePlay3");
 matchingGame.savingObject = {};

 matchingGame.savingObject.deck = [];

 matchingGame.savingObject.removedCards = [];

 // store the counting elapsed time.
  matchingGame.savingObject.currentElapsedTime = 0;

  //store the last-elapsed-time

//matchingGame.savingObject.LastElapsedTime = 0;//now


  // store the player name
  matchingGame.savingObject.palyerName=$("#player-name").html();
  matchingGame.savingObject.currentLevel="game6.html";
  // all possible values for each card in deck
matchingGame.deck = [
'cardAK', 'cardAK',
'cardAQ', 'cardAQ',
'cardAJ', 'cardAJ',

  ];

   $(  function(){init();}  );


  //initialise game
   function init() {


                    $("#game").addClass("hide");

                    $("#cards").addClass("hide");


                   uiPlay1.click(function(e) {
                    e.preventDefault();

            $("#popup").addClass("hide");
            startNewGame();


             });

                uiPlay2.click(function(e) {
                    e.preventDefault();
                $("#popup").addClass("hide");
                        var savedObject = savedSavingObject();
               // location.href =savedObject.currentLevel ;

                if (savedObject.currentLevel=="game6.html")
                 rejouer();
                 else 
                 location.href =savedObject.currentLevel ;

                //ResumeLastGame();
                //alert ("level :"+savedObject.currentLevel );

                });

            uiExit.click(function(e) {e.preventDefault();
                                     //alert("u clicked me ");
                                    }
                        );



                uiPlay3.click(function(e) {
                e.preventDefault();
                $("#popupHelp").fadeIn(500, function() {
                $(this).delay(10000).fadeOut(500)}); });


    }
Run Code Online (Sandbox Code Playgroud)

有任何想法,请提前感谢你

SLa*_*aks 5

你可能没有包含jQuery.