MVC

All JavaScriptMVC objects, classes, and methods are contained within the MVC namespace. This is done to prevent clashes with any other libraries being used, like jQuery or Prototype.

When no_conflict mode isn't on, classes can be accessed by their MVC-less names.

app_name, apps_root, Browser, include_path, Initializer, no_conflict, mvc_root, page_dir

Methods

no_conflict

MVC.no_conflict()

Turns on no_conflict mode. This causes all objects, classes, and methods to be wrapped in the MVC namespace. By default, no_conflict mode is off.

Initializer

MVC.Initializer(func)

Defines a function that is called once the plugins and files have all been included. This function is deprecated. It used to be the best way to start up your application, running code when everything else has loaded. Currently, the best way to do this is by creating a 'load' action in the MainController, which runs on document load.

Objects

app_name

MVC.app_name -> String

The name of your application, set in the script tag where you load include:

<script src="include.js?myapp,production" type="text/javascript"></script>

apps_root

MVC.apps_root -> String

The relative path to the apps directory from your current page.

Browser

MVC.Browser -> Object

JavaScriptMVC performs browser sniffing and stores the result in the Browser object. One of the following browser engine variables is set to true, the others to false: Gecko, IE, MobileSafari, Opera, Webkit

include_path

MVC.include_path -> String

The absolute path to include.js.

mvc_root

MVC.mvc_root -> String

The relative path to the jmvc directory.

page_dir

MVC.page_dir -> String

The absolute path to the directory that holds the current web page.