Improving Tooltips with json data
function FormatToolTip() {
    "use strict";

    amplify.request.define("listTooltips", "ajax", {
        url: "resources/prototype/tooltips.json",
        dataType: "json",
        type: "GET"
    });

    amplify.request({
        resourceId: "listTooltips",
        success: function (data) {
            amplify.store('tooltips', data.toolTips);
        }
    });

    // Get the tooltip from storage, given it's id
    this.buildToolTip = function (id) {
        var tips = amplify.store('tooltips');
        for (var i = 0, len = tips.length; i &lt; len; i++) {
            var val = tips[i];
            if (id == val.id) {
                return val.text;
            }
        }

        // This doesn't appear to be used?
        //return amplify.store(this.ToolTipId);
    };

    // Don't think this is used either
    /*
    this.setToolTipId = function (toolTipId) {
        if (toolTipId != undefined || toolTipId != null) {
            amplify.store(this.ToolTipId, toolTipId);
        }
    };
    */
}


Just use a data attribute in your markup: &lt;a href="#" data-tip-id='1010' data-placement="right"&gt;&lt;/a&gt;

And initialize like so:

&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        var tips = $('[data-tip-id]');
        var toolTip = new FormatToolTip();

        tips.each(function(){
            var this = $(this);
            var data = toolTip.buildToolTip(this.attr('data-tip-id'));
            this.attr('title',data) // Set the title so .tooltip() works
                .tooltip(); 
        });
    });
&lt;/script&gt;


* Untested