Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

JS Web Resources Not Loading in IE

  • 1.  JS Web Resources Not Loading in IE

    TOP CONTRIBUTOR
    Posted Jan 08, 2020 09:42 AM
    What would cause a JS Web Resource to not load in IE?

    I'm updating our JS for transition to the UCI. While we previously had a single script for each entity, which contained copies of shared functions. I've created a shared JS resource file to contain any shared scripts and form now references three web resources; the shared, a form-specific resource, and the old scripts which are being replaced.

    These resources all work fine in Chrome, accross multiple entities, fields, etc.  IE however, is throwing errors. Only one of the two new scripts appears to be loading in the IE Dev Tools (F12). The shared script simply isn't there. I've deleted browser history / cache, and still nothing. I've checked the code for errors. Neither Visual Studio, nor JSLint.com are flagging anything.

    What would prevent a JS Web Resource from loading in IE?

    ------------------------------
    Ryan Perry
    Business Systems Analyst
    Auric Solar
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: JS Web Resources Not Loading in IE

    GOLD CONTRIBUTOR
    Posted Jan 08, 2020 11:58 AM
    Hey Ryan,

    What version of IE are experiencing this issue with? I have seen issues in IE with syntax in the past. Does it work in Edge?

    ------------------------------
    Doug Apicella
    Solution Architect
    Hitachi Solutions America, Ltd.
    Greenville SC
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: JS Web Resources Not Loading in IE

    TOP CONTRIBUTOR
    Posted Feb 03, 2020 02:07 PM

    @Doug Apicella, @Rex Kenley Tan,

    Thanks,. Doug was right.  After taking a break and working on other things for a while, I came back to this. Turns out I used Template Literal Syntax when debugging:

    console.log(`aur_setTabVisibility: tabName: ${tabName} testField: ${testField} testFieldValue: ${testFieldValue} testValue ${testValue}`);

    JSLint.com didn't indicate any issues with code. JSHint.com, however, threw a warning:  'template literal syntax' is only available in ES6 (use 'esversion: 6').
    Apparently, this still isn't supported by IE. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
    This caused the entire script file to not load in IE / the Outlook App. Simply removing the line (it was for debugging anyway) fixed the issue.

    ​​​

    ------------------------------
    Ryan Perry
    Business Systems Analyst
    Auric Solar
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 4.  RE: JS Web Resources Not Loading in IE

    TOP CONTRIBUTOR
    Posted Feb 03, 2020 02:25 PM
    Edited by Rex Kenley Tan Feb 03, 2020 02:32 PM

    @Ryan Perry

    Cool!

    Try adding this project to your code, it will take care of that "pesky" IE11 issue for you (browser shouldn't deprive you of the ES6 goodness). It also does transpiling, minifying, linting, testing and documentation for you. It can detect the browser that you are using and make the appropriate polyfills. So browsers that support es6 won't get "polyfilled", while browsers like IE will be "polyfilled".
    https://github.com/rexkenley/d365js




    ​​



    ------------------------------
    Rex Kenley Tan, MCSA, MCSD
    Tallmadge OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 5.  RE: JS Web Resources Not Loading in IE

    TOP CONTRIBUTOR
    Posted Jan 08, 2020 12:30 PM
    Edited by Rex Kenley Tan Jan 08, 2020 12:30 PM
    @Ryan Perry

    Any chance that there are errors before that script is "loaded"? You can compare the network traffic between browsers to determine where it is "supposed" to load.

    I would suggest that you compile your 3 scripts into one to avoid issues like this. Please take a look at my github on how to do that
    https://github.com/rexkenley/CrmUG2019

    This project is configured to work with all major browsers so you don't have to worry about specific browser "quirks" anymore.

    Cheers!

    ------------------------------
    Rex Kenley Tan, MCSA, MCSD
    Tallmadge OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 6.  RE: JS Web Resources Not Loading in IE

    TOP CONTRIBUTOR
    Posted Jan 10, 2020 01:38 PM
    I thought maybe you might be interested.
    https://github.com/rexkenley/d365js

    ------------------------------
    Rex Kenley Tan, MCSA, MCSD
    Tallmadge OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role