Skip to content

Instantly share code, notes, and snippets.

@searls
Created November 19, 2010 21:22
Show Gist options
  • Save searls/707202 to your computer and use it in GitHub Desktop.
Save searls/707202 to your computer and use it in GitHub Desktop.
(function($){
$.jasmine = {
isReady:false,
rootId: 'specContainer',
inject:function(html,overwriteAll) {
if($.cil.jasmine.isReady === false) $.cil.jasmine.init();
if(overwriteAll === true) {
$('#'+$.cil.jasmine.rootId).html(html);
} else {
$('#'+$.cil.jasmine.rootId).append(html);
}
},
init: function() {
$('body').append('<div id="'+$.cil.jasmine.rootId+'"></div>');
$.cil.jasmine.isReady = true;
},
tidyUp: function() {
$('#'+$.cil.jasmine.rootId).remove();
$.cil.jasmine.isReady = false;
}
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment