Inject a jquery code to a HTML page dynamically - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Inject a jquery code to a HTML page dynamically

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
    $(function(){//from w  ww  . jav  a 2s  .  c o m
var map_js = '<script language="javascript" type="text\/javascript"> console.log("Js");<\/script>'

jQuery('head').append(map_js);
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials