Javascript examples for jQuery:String
Insert dynamically string containing script into HTML and executing it dynamically
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> <script type="text/javascript"> var jsCode = '<script>var executeTest = function(){ console.log("This is a test."); }</script>'; $('head').append(jsCode); </script> </head> // w ww .ja va 2s. c o m <body> <script>executeTest();</script> </body> </html>