javascript - Using <script> tag within editable email notification dialog in Jenkins -
i writing simple html in editable email notification dialog box:
<!doctype html> <html> <body> <p id="demo"> </p> <script type="text/javascript"> document.getelementbyid("demo").innerhtml = "this js"; </script> </body> </html> however unable see string " js" in generated email. not sure doing wrong ? pointers?
you have js, seems never call it. try running in load or ready function.
<script type="text/javascript"> window.onload = function() { document.getelementbyid("demo").innerhtml = "this js"; }; $( document ).ready(function() { document.getelementbyid("demo").innerhtml = "this js"; }); </script> i think trying do.
update:
alright, found function work you. here the fiddle.
<body> <p id="demo"></p> <script> document.addeventlistener("domcontentloaded", function() { document.getelementbyid("demo").innerhtml = "this js"; }); </script> </body>
Comments
Post a Comment