I\'m trying to cobble together a php style include function for javascript. The route I\'m taking is through a XMLHttpRequest. The included file will load, but the functions
Change the way you declare your functions and it should solve the scoping issue. Instead of:
function add(a, b) { return a + b; }
do this:
var add = function(a, b) { return a + b; }