I've created a JavaScript web browser game. The HTML page, Game.html
, within folder Game
references several other JS/jQuery/CSS files stored in sub folders.
I simply want to add the Game
folder, which includes the Game.html
file and all of its related files to SharePoint 2013 as a page. That way people can play the game on SP 2013.
I've tried the following:
Clicked
Add Page
. This gives me the Master Page and only allows me to add web parts. So I tried adding a Content Editor Web Part and tried to reference theGame.html
page, but then I can't reference the rest of the needed JavaScript.Then I mapped my drive directly to the server and uploaded my
Game
folder to the server. From there, I created a Master Page ofGame.html
in Design Manager... this did not work.
Is there a simple way to add my Game.html
page to SP 2013 and have it reference all of its required JS files and actually run the game?
Thanks
Edit: Okay, here's what I did:
1) I uploaded all assets to http://server/SiteAssets/Forms/AllItems.aspx
, including main Game.html
file, and supporting images and JS files.
2) Changed all references in Game.html
to match the same folder that Game is in:
<script src="http://Server/SiteAssets/createjs.js"></script>
<script src="http://Server/SiteAssets/bootstrap.js"></script>
<script src="http://Server/SiteAssets/jquery.js"></script>
etc...
3) Went to Settings -> Add a page
, which is now at http://Server/Pages/Game.aspx
.
4) Added Content Editor Web Part (CEWP) to new Page, titled Game
. Edited the CEWP to get the Game.html
file located in SiteAssets
.
5) Game.html
seems to render okay:
However, when I submit my name in the text box, it's supposed to run the JavaScript game. But it's not working. I know it's running JavaScript because I did:
Game.html: <body onload="test()">
Game.html: function test() { alert("working"); }
Outputs "working".
There's no console output error. And the jQuery and rest of the code seems to render for a second, flicker, and then return to the static HTML...
Any thoughts?
sharepoint 2013 conversion to application
doesn't turn up anything useful.