An implementation of Robowars (http://robowar.sourceforge.net/RoboWar5/index.html) in Javascript (http://statico.github.io/jsrobowar/) is running online without problems in IE, Google Chrome and Firefox. The code can be downloaded from GitHub (https://github.com/statico/jsrobowar) as jsrobowar-master.zip. After unpacking the off-line program only runs in IE; Firefox shows error messages "errror compiling ..." , Google Chrome ".... error at line undefined, undefined at". It seems that the robotcode text files in the robots subdirectory IE only be read correctly in HTML TEXTAREA 's and transmitted to the robot code compiler in js / jsrobowar.js (see code fragment from js / gui.js) -------------------------------------------------- ----------------------------- / / Load robot code into the editor when a robot is selected. select.change (function () { var name = $ (this) val ().; if (name) { var path = 'robots /' + name + 'txt.'; textarea.val ((Loading '+ path +') '); textarea.attr ('disabled', 'disabled'); $. get (path, function (src) { textarea.val (src); textarea.attr ("disabled", null); }); } }); -------------------------------------------------- ------------ Cleaning up the javascript code in both files with JSLint and JSHint offers no solace. On Internet forums I found items about problems with TEXTAREA in Javascript, but as a newbie I found no solution there. I want to start a jsrobowar programming competition, and want to have a browser-independent implementation. Is there anyone who knows of this problem and has a solution for it? aTdHvAaNnKcSe. ôvô vriendelijke groet (\/) ^^ Peter Uilenreef
You can't just open the file directly in the browser, the ajax requests are failing, and that is what is causing your problem. It has to be hosted, even on a local setup, you will need to have it served from a webserver. the XMLHTTPRequests are failing, because they are not allowed to load local files for security reasons. If you are using windows you could install WAMP or even just apache or any other web server to self host, and access the application in the browser like: http://127.0.0.1/jsrobowar-master/index.html Code (markup): and it will work cross browser. WAMP: http://sourceforge.net/projects/wampserver/