Note that there are some explanatory texts on larger screens.

plurals
  1. PORefreshing CRM Page Causes jQuery/Javascript Error
    text
    copied!<p>Ladies and gents,</p> <p>I have a CRM page which references 3 js files, (1x jQuery, 2x custom) all stored in the CRMInstall/isv/ folder.</p> <p>On the form OnLoad method, I am loading each one and then using it to extend/customise the UI.</p> <p>My inexperience with jQuery is obviously showing however!</p> <p>The OnLoad code is below:</p> <pre><code>//jquery var url = "/isv/jquery-1.4.2.js"; var scriptElement = document.createElement("&lt;script src='" + url + "' language='javascript'&gt;"); document.getElementsByTagName("head")[0].insertAdjacentElement("beforeEnd", scriptElement); $(document).ready(function() { $.getScript("/isv/common.js", function() { $.getScript("/isv/account.js", function() { $(document).ready(function() { SetUpAccountForm();//call to account.js }); }); }); }); </code></pre> <p>And this causes the following (using IE8):<br/> First page load (no files in temporary internet files folder)<br/></p> <ul> <li> error when hitting the $(document).ready(function(){})</li> </ul> <p>Second page load (all files now in temporary internet files folder)<br/></p> <ul> <li> page/loads functions fine</li> </ul> <p>hit F5 (refresh)</p> <ul> <li> error when hitting the $(document).ready(function(){})</li> </ul> <p>Where am I going wrong? Is it because I am adding a reference to the jQuery script twice?</p> <p>In both cases the error reads:</p> <blockquote>There was an error with this field's customized event.<br/> Field:window<br/> Event:onload<br/> Error:Object expected<br/></blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload