I have some jQuery that loads a new stylesheet like so…
$('head').append('<link rel="stylesheet" type="text/css" href="' + config.basePath + config.stylesheetsPath + 'sections/' + name + '.css" media="screen" class="new site-specific" />');
I am then attempting to get some info from that CSS file immediately after. It generally will not display the correct information until the second trigger of the event (after I imagine the stylesheet has loaded).
Is there any event I can attach to trigger when the CSS is loaded?
I don’t know about triggering an event, but can you make an get request for the CSS file and then just update the
<head>with a new<style>tag, placing the content of the file inside the<style>tag?