Execute scripts inside document.getElementById().innerHTML


 Execute <script> (Java Script) tag from innerHTML
 -------------------------------------------------------------
 1. Replace <script> your script data to be executed. </script> tag
    with <div class="javascript">your script data to be executed. </div> 


2. add a style in your page...
   <style type="text/css"> .javascript { display: none; } </style>

3. Now run  eval using jquery(Jquery js should be already included)
     $('.javascript').each(function() {
      eval($(this).text());
    });

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Session timeout interceptor in struts 2