Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I followed the JSIL website and github guide, and I think my game is ready to be used in an HTML + javascript file, but I can't figure out why it giving me a loading error:

Loading data ... failed.
Unhandled exception at file:///C:/Users/Travis/Documents/GitHub/JSIL/bin/minesweepertest.html line 29:
Uncaught TypeError: undefined is not a function



Here is the HTML file i'm running:

HTML
<!DOCTYPE html> 
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
  </head>
  <body onload="onLoad()">    
    <script type="text/javascript">
      var jsilConfig = {
        printStackTrace: false,
        xna: 4,
 
        manifests: [
          "minesweeper.exe",
          "Content/minesweeper.contentproj"
        ],
      };
    </script>
    <script src="../Libraries/JSIL.js" type="text/javascript"></script>
    
    <canvas id="canvas" width="1280" height="720">
    </canvas><br>
 
    <div id="log"></div>
 
    <script type="text/javascript">
      function runMain () {
        // We can't invoke Main() since it disposes the Game immediately, breaking everything.
        var asm = JSIL.GetAssembly("minesweeper", true);
        var game = new asm.minesweeper.minesweeper();
        game.Run();
      };
    </script>
  </body>
</html>


The error on line 29 is highlighted, JSIL says it should be:
C#
var game = new asm.YOURNAMESPACE.YOURGAME();


What am i doing wrong?

The basic JSIL HTML template is found here: https://gist.github.com/kg/3702486[^]
Posted
Updated 16-Aug-13 4:58am
v4
Comments
Do you have this minesweeper.exe?
clonze 16-Aug-13 10:56am    
yes, it's a game that I made for c#XNA, JSIL turns it into a javascript that i can run on an HTML page

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900