web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

html web resource can't find a js web resource

(0) ShareShare
ReportReport
Posted on by 515

I've a html web resource, which is an onclick event from a html button.

I've added the script to the top of my html resource

    <script src="../scripts/fileName.js"></script>

It's not finding the function (it works if I put the function directly in the html web resource).

Is there something I'm missing?


Thanks
Lee

I have the same question (0)
  • meelamri Profile Picture
    13,218 User Group Leader on at

    Hi, 

    Could you share the full name of your js and html page? Example: prefix_/Scripts/ScriptName.js

  • Lee-Martin Profile Picture
    515 on at

    js

    name: aa_/scripts/fileName.js

    display name: /scripts/fileName.js

    html

    name: aa_/html/htmlFileName

    display name : /html/htmlFileName

  • Charan Raju C R Profile Picture
    7 Moderator on at

    Did you check this javascript library for any syntax errors?

    Does it contains only one function which is working fine when you embed inside the HTML?

  • Lee-Martin Profile Picture
    515 on at

    It contains multiple functions. All the others work as required (it's the way the business works).

    As I said above, the function does work fine when put into the html web resource

    the error message is

    ReferenceError: myFunctionName is not defined at HTMLInputElement.onclick

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    Hi, 

    Open your Console, load your html page and look for an error that is close to this one: 

    pastedimage1624363637493v2.png

    If you find this kind of error, please share a screenshot..

  • Lee-Martin Profile Picture
    515 on at

    Thanks Mehdi

    I found this

    DevTools failed to load source map: Could not load content for mycrm-app/.../fileName.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

  • Suggested answer
    meelamri Profile Picture
    13,218 User Group Leader on at

    The console shows the wrong URL that you have to correct. The correct URL is the one in the image below.

    pastedimage1624365810450v1.png

    The URLs must match, good luck !

  • Lee-Martin Profile Picture
    515 on at

    Thanks

    So I need to put the full URL in?

  • meelamri Profile Picture
    13,218 User Group Leader on at

    You need to find the right relative path. Do not use the full URL ;)

  • Lee-Martin Profile Picture
    515 on at

    Thanks, but the question I've been asking is, what is the right relative path?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 79

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans