According to some benchmarking mentioned in this question overflowing https://stackoverflow.com/a/212960/289 , I believe that the most efficient way to create your HTML element using jQuery would be as follows:
$('<div class="iviewer_image_mask" style="background: url(http://somesite.com/path/to/image.jpg);"></div>').appendTo(this.container);
Or for some extra readability:
var elm = '<div class="iviewer_image_mask" ' + 'style="background: url(http://somesite.com/path/to/image.jpg);">'+ '</div>'; $(elm).appendTo(this.container);
Christofer eliasson
source share