Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8358083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:41:15+00:00 2026-06-09T10:41:15+00:00

Following up from my solved [previous issue][1], I’m having trouble building a simple HTML

  • 0

Following up from my solved [previous issue][1], I’m having trouble building a simple HTML Web resource containing some basic javascript, page is rendered correctly but script doesn’t seem to work properly.

My HTML resource is very basic:

<html>
<head>
    <script src="ClientGlobalContext.js.aspx" />
    <script type="text/javascript" src="new_jquery_1.7.2.min" />
    <script type="text/javascript">    

        function buttonClick() { alert('Yo !'); }

    </script>
</head>
<body>
    <input type="button" value="Test" onclick="javascript: buttonClick();" />
</body>
</html>

Although the page shows up fine, clicking the button yields The value of the property is null or undefined not a function object error like the functions wasn’t there, but I checked via F12 console that the code is rendered correctly.

I also tried invoking the web resource via the direct url, in the form of

http://mycrmserver/myorg/WebResources/new_myResource

But (as I expected) the behavior of the page was the same.

I checked Google, I surfed a couple of other SO questions and MSDN and all state this is the right way to do it, what’s wrong with my code ?

Other (not sure if useful) details:

  • If the F12 tool is open the error comes up as a SCRIPT5007 javascript runtime error in the console. If it’s not, I get the usual script error notify popup if I browse to the webresource direct url, or nothing happens at all if I try to open the resource inside the CRM.
  • The CRM environment is updated to Rollup 3 (updating it is not an option unfortunately)
  • I’m using IE 9 (Remember: Dynamics CRM can’t be used in non-IE browsers yet)

UPDATE
Shorthand tags confuse the CRM.

Basically this syntax sometimes gets messed up:

<script src="ClientGlobalContext.js.aspx" />

But this works perfectly:

<script src="ClientGlobalContext.js.aspx"></script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:41:17+00:00Added an answer on June 9, 2026 at 10:41 am

    Root cause is a missing script tag, despite the code you posted being correct.

    CRM does some messing about with the HTML you post into the script editor window. What is rendered in the browser is this (note that the ClientGlobalContext.js.aspx tag is not closed in the same way as your pasted code):

    <HTML><HEAD>
    <SCRIPT src="ClientGlobalContext.js.aspx">
    <script type="text/javascript" src="new_jquery_1.7.2.min" />
    <script type="text/javascript">    
    
        function buttonClick() { alert('Yo !'); }
    
    </SCRIPT>
    
    <META charset=utf-8></HEAD>
    <META charset=utf-8></HEAD>
    <BODY><INPUT onclick=javascript:buttonClick(); value=Test type=button></BODY></HTML>
    

    Resolution:
    Add full “close” tags to each opening script tag (rather than using “/>”).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is the following From header incorect? // To send HTML mail, the Content-type header
I have a problem following from my previous problem . I also have the
Following on from my previous question , I have now managed to rotate my
Following on from this question , I'm using a simple ViewModel class to test
Following on from a previous post , I'm trying to update a database field
From my previous question I have solved how to display information from MS Access
I'm having the following problem, and would love some pointers in the right direction.
Following from this: Every specific weekday, sql and php I got this: deals_bookings.everyWeekDay =
Following from my last question which @Jon Skeet gave me a lot of help
Following from these question Subset sum problem and Sum-subset with a fixed subset size

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.