missing event when using modules with requirejs
- by ali haider
I had javascript code in a single JS file that was working fine (using XHR/AJAX).  When I split it up into separate modules in a requirejs application, I do not seem to get a handle on the event object & it shows up as undefined (testing in firefox 29.0.1).
Calling module:
ajax.onreadystatechange = new ajaxResponse().handleAjaxResponse(e); 
ajaxResponse
    define(["require", './url/urlCommon'], function(require, urlCommon) {  
        'use strict';
        var ajaxResponse = function() { 
               var ajax = null;
              // e = event || window.event;
               this.handleAjaxResponse = function() { 
                   if (typeof event === 'undefined') {
                          var event = event || window.event;
                       }
                      console.log('e is now:' + typeof e);
I also do not have a handle on the event in the handleAjaxResponse method (error: undefined).  Any thoughts on what I need to do to troubleshoot/fix this will be greatly appreciated.