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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -