I created a webpage in Moodle using the "Add and activity or resource" feature. On this page I added a link to another page. The Moodle webpage opens in an embedded iframe so when I click the link to another page, it opens the page in the same iframe.
To avoid this, I added javascript to jump out of the iframe back to the top.
<script type="text/javascript">
if (top.location!= self.location)
{ top.location = self.location.href }
</script>
I logged in and created the page as the administrator. I set the security setting to allow for Trusted Content. I verified that the administrator does indeed have the permission for trusted content. But when I save the webpage, Moodle cleans the HTML like this:
<script type="text/javascript">// <![CDATA[
if (top.location!= self.location)
{ top.location = self.location.href }
// ]]></script>
The javascript is commented out and will not run.
Does anyone have a solution to this problem?
Thanks,
Clarence