javascript - Enable script tags with different type? Changing type attribute is not enought -


is possbile run code previosly of ignored content type. example:

<script type="jquery">alert('working!')</script> 

of course tag ignored , not enable it. tried this:

$(document).ready(function() {     $('script[type=jquery]').attr('type','text/javascript'); }); 

but nothing happens :/

thanks help!

yes can it, option recreate new script tag , remove existing:

$(document).ready(function() {      $('script[type=jquery]').each(function(){          $(this).after(this.outerhtml.replace('jquery','text/javascript')).remove();      })  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>    <script type="jquery">alert('working!')</script>


Comments

Popular posts from this blog

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -