Modding Tip of the Day

Discussion in 'Mod Discussions' started by oxide246, July 17, 2013.

  1. oxide246

    oxide246 Active Member

    Messages:
    249
    Likes Received:
    30
    Trying to write an interface which keeps breaking and you have NFI what's causing it? Try this out!

    After the common.js include in the html file you are editing which looks like this:

    Code:
    <script src="../shared/js/common.js" type="text/javascript"></script>
    Add:

    Code:
    <script>
    window.onerror = function(message, url, linenumber) {
    	gameConsole.log("JavaScript error: " + message + " on line " + linenumber + " for " + url + "\n");
    }
    </script>
    Your errors will now appear in the game console which can be seen by pressing they ` key.

Share This Page