John’s public wiki

Public pages of John’s personal knowledge base


Project maintained by af4jm Hosted on GitHub Pages — Theme by mattgraham

(home)

coding standards

This was written in , much of this is obsolete. ___ would be filled in with the name of the company or organization that owns the code.

Branding & Identity

Maintainability

Source Control

Visual Studio

Globalization & Localization

SQL

Web Services

Web

CSS

JavaScript

(function moduleIIFE() {
    "use strict";
    var window, ___, module;
    window = this; // in a browser, should be window
    ___ = window.___ = window.___ || {};
    module = ___.module = ___.module || {};
    // code goes here, including $(window.document).ready or window.pageLoad
}).call(this);
// this example assumes the code is inside an IIFE as shown above
module.pageLoad = function (sender, args) {
    // code goes here
}

if (window.pageLoad) {
    module.pageLoadExisting = window.pageLoad;
    window.pageLoad = function (sender, args) {
        module.pageLoadExisting(sender, args);
        module.pageLoad(sender, args);
    };
} else {
    window.pageLoad = module.pageLoad;
}

where module is the name of whatever module is defined in that script

window.pageLoad = function (sender, args) {
    /// <summary>Wrap AjaxControlToolkit pageLoad in a jQuery event, so multiple handlers can be added.</summary>
    /// <param name="sender" type="Sys._Application">Application object the event is acting upon.</param>
    /// <param name="args" type="Sys.ApplicationLoadEventArgs">Application load event arguments.</param>
    /// <returns type="undefined" />
    $(window.document).trigger("ajaxToolkit-pageLoad", sender, args);
};
$(window.document).on("ajaxToolkit-pageLoad", function (event, sender, args) {
    /// <summary>AjaxControlToolkit pageLoad.</summary>
    /// <param name="event" type="jQuery.Event">jQuery event object.</param>
    /// <param name="sender" type="Sys._Application">Application object the event is acting upon.</param>
    /// <param name="args" type="Sys.ApplicationLoadEventArgs">Application load event arguments.</param>
    /// <returns type="undefined" />

    // code goes here
});