var SPNAPI = (function(SPNAPI, $, undefined) { SPNAPI.methods = {}; SPNAPI.pages = ["Settings", "eyedea", "iguana","Debug","Wallet"]; SPNAPI.pageContent = {}; SPNAPI.page = "welcome"; $(document).ready(function() { //load Pages into the navbar $.each(SPNAPI.pages, function( index, value ) { $("#welcome").after(''); }); $(".navigation").on("click", function () { var page = $(this).data("page"); $(".navigation").removeClass("active"); $(".hljs").html("JSON response"); SPNAPI.loadSite(page); }); $(".page").hide(); $("#welcome_page").show(); $(".submit_api_request").on("click", function () { SPNAPI.submitRequest(); }); $(".clear-response").on("click", function () { $(".hljs").html("JSON response"); }); }); SPNAPI.submitRequest = function(e) { //code added in order to be able to receive input from or