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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -