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

Re: Not obeying directory loading structure

Expand Messages
  • Ben McClure
    And I was naming my class file main.js but it needed to be Main.js with an uppercase letter to load properly.
    Message 1 of 3 , Apr 22, 2010
    • 0 Attachment
      And I was naming my class file "main.js" but it needed to be "Main.js" with an uppercase letter to load properly.

      --- In ajile@yahoogroups.com, "Ben McClure" <digitalempire@...> wrote:
      >
      > 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?
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.