Loading ...
Sorry, an error occurred while loading the content.

273Not obeying directory loading structure

Expand Messages
  • Ben McClure
    Apr 22, 2010
    • 0 Attachment
      I have been trying all day to get Ajile to properly load my classes from a directory structure.

      My javascript is all in /js

      Ajile is at /js/com/iskitz/ajile.js
      My Main class is at: /js/com/singularityshift/webmanager/main.js

      My index file (along with some other valid JS) has the following:

      ---------------------------------------------
      // Set Ajile options
      Ajile.EnableCloak(false);
      Ajile.EnableDebug();
      Ajile.EnableOverride(false);
      Ajile.EnableRefresh(true);

      // Load third-party libraries
      Load('/js/jquery-1.4.2.min.js');
      Load('/js/jquery-ui-1.8.custom.min.js');
      Load('/js/jquery.bgiframe-2.1.1.js');
      Load('/js/jquery.cookie.js');
      Load('/js/jquery.metadata.js');

      // Define container namespace
      Namespace('com.singularityshift', null, '/');

      // Define application namespace
      Namespace('com.singularityshift.webmanager');

      // Import the main application class
      Include('com.singularityshift.webmanager.Main');

      Ajile.AddImportListener(function(moduleName) {
      alert(moduleName);
      });
      --------------------------------------------------------

      I only get one alert box which says 'com.iskitz.ajile'

      When I look at the console output in Firebug, I can see it is using '.' as a separator and trying to load all of my classes using the default method instead of obeying neither the loading structure i used for ajile.js nor the '/' separator I specified in the namespace.

      --

      On a possibly-related note, this is a CakePHP site and if you try to load a file from /js that does not exist, you get a CakePHP-generated HTML error page instead of a generic 404... could it be trying to load the non-existent page, thinking it's valid, and not looking any further?
    • Show all 3 messages in this topic