-
Bug
-
Resolution: Not a bug
-
Low
-
None
-
3.5, 4.0, 4.1, 4.2
-
Chrome 20
Some JavaScripts do not work on Chrome after saving, although it is working upon previewing or refreshing the page. Some simple JS would work, but those that include JS functions won't work.
Steps to reproduce
- Make you sure you enable the HTML macro
- Create a new page and insert HTML macro
- Add the following code in the macro:
<script type="text/javascript">function displayDate() { document.getElementById("demo").innerHTML=Date(); }</script> <p id="demo">This is a paragraph.</p> <button type="button" onclick="displayDate()">Display Date</button>
- Save the page
- Click on "Display Date" button and nothing is displayed
NOTE: In the Chrome console (F12), the following error is displayed: "Refused to execute a JavaScript script. Source code of script found within request." This error does not occur when you refresh the page.
Workaround
Refresh the page and the JavaScript will execute!
Hi Steve. Thanks for the explanation
I'll inform the customer about that.