Skip to content

Instantly share code, notes, and snippets.

@daniellmb
daniellmb / onerror.js
Last active July 12, 2020 13:30
Automagically look up JavaScript errors on Stack Overflow ;-)
window.onerror = function(message) {
top.location.href = 'http://stackoverflow.com/search?q=' +
encodeURIComponent(message + ' [js]');
};
createsitecolumn: function () {
var fieldschema = '<Field Type="' + sitecolumntype + '" Name="' + sitecolumnname + '" DisplayName="' + sitecolumndisplayname + '" Group="JSOM Provisioned Columns" />';
var dfd = $.Deferred();
var ctx = getContext();
var appctx = getAppContextSite(ctx);
var targetWeb = appctx.get_site().get_rootWeb();
var fields = targetWeb.get_fields()