I have the following code:
<div class="row">
<div>
<iframe id="myFrame" name="myFrame" class="btn-block" ng-src="{{myframeSrc | trusted}}" onLoad="contentChanged()" scrolling="no"></iframe>
</div>
<script type="text/javascript">
var contentChanged = function() {
alert('frame content has changed');
};
</script>
I know this is supposed to work (and it does), as the alert does popup. However, I'm getting an [Uncaught ReferenceError: contentChanged is not defined] error. What am I doing wrong? Note: I'm loading the src thru Angular, but needed plain javascript to detect frame source changing when a link is clicked outside of Angular inside the iFrame.