jQuery add stylesheet if not loaded

Code snippet quicky. Use jQuery to add a setylesheet if it’s not already loaded.

var cssUrl = 'css/style.css';
if($('link[rel*=style][href="'+cssUrl+'"]').length==0)
{
    $("head").append('<link rel="stylesheet" type="text/css" href="'+cssUrl+'">');
}