javascript - Find a script in head with jquery based on it's data-attribute -
javascript - Find a script in head with jquery based on it's data-attribute -
in content editor can alter custom webfonts on fly. if alter font, deletes scripts , styles using data-attribute identifier , new ones appended after ajax call. after testing realised work's css files ignores < script >'s. ideas? here script:
$('head').find('[data-fontset-id=ce-fontset]').each(function() { $(this).remove(); });
for illustration how head section looks like:
<link data-fonset-id="ce-fontset" rel="stylesheet" href=".........."> <script data-fonset-id="ce-fontset" type="text/javascript" src="//use.typekit.net/xxxxx.js"></script> <script data-fonset-id="ce-fontset" type="text/javascript">try{typekit.load();}catch(e){}</script>
in example, css file gets removed javascript files didnt, ideas why beingness ignored?
thanks lot in advance, michael
javascript jquery html css
Comments
Post a Comment