asp.netjquery-globalize

jQuery Globalize plugin giving an error always in an aspx Webforms page


I have a simple aspx page using jQuery globalize plugin that I created based on the Demo solution from this url: https://weblogs.asp.net/scottgu/jquery-globalization-plugin-from-microsoft.

I am using Visual Studio 2013 Pro version with .Net framework 4.5.1 and the project with this aspx page is a website project.

I always get a JavaScript error when this simple aspx page renders. A screenshot of this error is as below. The markup of this simple aspx is also given below. No code-behind code is being used for this page.

Question : What could be causing this since similar code in Demo samples from Scott's blog works without any errors? All script files are correctly loading that I verified in Chrome's Source tab, so this is very confusing.

jQuery Globalize plugin Error

Markup of simple aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default18.aspx.cs" Inherits="Default18" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>UK Store</title>
    <script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jQuery.glob.min.js" type="text/javascript"></script>
    <script src="Scripts/globinfo/jQuery.glob.en-GB.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $.preferCulture("en-GB");
    </script>

</head>
<body>
    <h1>Apple Strudel</h1>
    Product Price: <span id="price"></span>
    <br />
    Date Available: <span id="available"></span>
    <br />
    Units in Stock: <span id="units"></span>
</body>
</html>


Solution

  • I finally found the problem. The minified file jQuery.glob.min.js that was in the Demos solution at https://weblogs.asp.net/scottgu/jquery-globalization-plugin-from-microsoft was not correct, but jQuery.glob.js from same location was correct since my aspx page worked with it.

    So I just created a new minified file using jQuery.glob.js and then everything worked perfectly with my aspx page.