locked
CRM 2013 HTML Web Resource removed Body OnLoad event RRS feed

  • Question

  • Hi All,

    I have a pretty standard web resource to change the source of an Iframe depending on text entered into a box, however when I publish it, the onload event of the Body tag is removed.

    I have modified the function called by the onload from the actual functionality that I want, to a standard alert of "Loaded", but even this won't pass.

    The entire contents of the file is below

    <html>
    	<head>
    	<script type="text/javascript">function callASPX() {var uid = Xrm.Page.context.getUserId(); var server =Xrm.Page.context.getServerUrl(); document.getElementById("Search").src="<some url>";}</script>
    		<script type="text/javascript">function call() {alert("loaded");}</script>
    	</head>
    	<body onload="call()">
    		<iframe id="Search" src="about:blank"></iframe>
    	</body>
    </html>

    So far 2013 has been riddled with bugs, so I'm wondering if this is one of them

    Thanks!

    Thursday, January 23, 2014 12:36 PM

Answers

  • I wasn't aware of this problem, but what you could try is something like this instead:

    <script type="text/javascript">
        function call() {
            alert("loaded");
        }
        window.onload = call;
    </script>

    And forget about the body onload event


    Thursday, January 23, 2014 1:05 PM

All replies

  • I wasn't aware of this problem, but what you could try is something like this instead:

    <script type="text/javascript">
        function call() {
            alert("loaded");
        }
        window.onload = call;
    </script>

    And forget about the body onload event


    Thursday, January 23, 2014 1:05 PM
  • Using the window.onload like that worked like a charm!

    Thanks :)

    Thursday, January 23, 2014 3:54 PM