jQuery UI Widgets Forums General Discussions ASP .NET MVC ASP .NET CORE Charts Uncaught ReferenceError: $ is not defined

This topic contains 7 replies, has 7 voices, and was last updated by  noroj99012 5 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author

  • PawelKanarek
    Participant

    Hi everyone!
    I have problems with presenting charts on ASP.NET CORE 2.0, using MVC.

    I’ve installed yours product (followed this instruction on github).

    So, firstly i added nuget https://www.nuget.org/packages/Chart.AspNetCore.Mvc/ to my existing project, updated _ViewImports.cshtml, then i rebuild solution and finally added a new chart object.

    Sadly i can’t see chart on the screen, there is some JS error with message “Uncaught ReferenceError: $ is not defined” as seen on this screenshot screenshot

    This is my Model

    
        public class ChartDataItem
        {
            public int Keith
            {
                get;
                set;
            }
            public int Erica
            {
                get;
                set;
            }
            public int George
            {
                get;
                set;
            }
            public string Day
            {
                get;
                set;
            }
        }
    

    This is my Index method

    
            public async Task<IActionResult> Index()
            {
                return View(new List<ChartDataItem>()
                {
                    new ChartDataItem() { Day="Monday", Keith = 30, Erica = 15, George=25 },
                    new ChartDataItem() { Day="Tuesday", Keith = 25, Erica = 25, George=30 },
                    new ChartDataItem() { Day="Wednesday", Keith = 30, Erica = 20, George=25 },
                    new ChartDataItem() { Day="Thursday", Keith = 35, Erica = 25, George=45 },
                    new ChartDataItem() { Day="Friday", Keith = 20, Erica = 20, George=25 },
                    new ChartDataItem() { Day="Saturday", Keith = 30, Erica = 20, George=30 },
                    new ChartDataItem() { Day="Sunday", Keith = 60, Erica = 45, George=90 }
                });
            }
    

    and finally this is my view

    
    @model IEnumerable<MeteoWww.Models.ChartDataItem>
    @using jQWidgets.AspNetCore.Mvc.TagHelpers;
    @{
        ViewData["Title"] = "Index";
    
        Padding padding = new Padding() { Left = 5, Top = 5, Right = 35, Bottom = 5 };
        Padding titlePadding = new Padding() { Left = 90, Top = 0, Right = 0, Bottom = 10 };
        Rectangle legendPosition = new Rectangle() { Left = 520, Top = 140, Width = 100, Height = 100 };
        FormatSettings formatSettings = new FormatSettings() { Sufix = "%", DecimalPlaces = 1 };
    }
    <div class="example-description">ASP .NET MVC Chart Line Series Example</div><br />
    <jqx-chart style="width: 850px; height: 500px;" color-scheme="scheme02" padding="padding" title-padding="titlePadding" title="Fitness & exercise weekly scorecard" description="Time spent in vigorous exercise" show-legend="true" legend-position="legendPosition" source="Model">
        <jqx-chart-x-axis datafield="Day" show-grid-lines="true"></jqx-chart-x-axis>
        <jqx-chart-series-groups>
            <jqx-chart-serie-group show-labels="true" columns-gap-percent="50" series-gap-percent="0" type=@SerieType.Line>
                <jqx-chart-value-axis axis-size="auto" display-value-axis="true" description="Time in minutes" tick-marks-color="#888888" min-value="0" max-value="100" unit-interval="10"></jqx-chart-value-axis>
                <jqx-chart-series>
                    <jqx-chart-serie symbol-type="square" datafield='Keith' display-text='Keith'></jqx-chart-serie>
                    <jqx-chart-serie symbol-type="square" datafield='Erica' display-text='Erica'></jqx-chart-serie>
                    <jqx-chart-serie symbol-type="square" datafield='George' display-text='George'></jqx-chart-serie>
                </jqx-chart-series>
            </jqx-chart-serie-group>
        </jqx-chart-series-groups>
    </jqx-chart>
    

    Can you guys help me to solve this error? You’ve made a great work on those widgets and it would be awesome to use them in my project.


    PawelKanarek
    Participant

    Any ideas? I think i did not install some javascripts…

    But i don’t see anywhere complete instruction how to install those charts for total newbie like i’m. I followed only this instruction and i think this is to little to activate those charts.


    Peter Stoev
    Keymaster

    Hi Pawel,

    The installation instructions are available here: https://www.jqwidgets.com/asp.net-core-mvc-tag-helpers-documentation/.

    $ is undefined means that jQuery reference is not available in the code.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com


    jefryarch
    Participant

    Basically $ is an alias of jQuery() so when you try to call/access it before declaring the function, it will endup throwing this $ is not defined error . This usually indicates that jQuery is not loaded and JavaScript does not recognize the $. Even with $(document).ready , $ is still going to be undefined because jquery hasn’t loaded yet.

    To solve this error:

    Load the jQuery library at the beginning of all your javascript files/scripts which uses $ or jQuery, so that $ can be identified in scripts .

    There can be multiple other reasons for this issue:

    * Path to jQuery library you included is not correct
    * The jQuery library file is corrupted
    * Working offline
    * Conflict with Other Libraries


    thinsys
    Participant

    Are you a asp programmer? use thin client and enjoy


    decorsanthuong
    Participant

    https://decorsanthuong.com/ là trang thông tin cập nhật thường xuyên về các kiểu mẫu, xu hướng và tổng hợp những mẹo vặt, thủ thuật mới nhất xoay quanh việc trang trí sân thượng.
    Thông tin Liên Hệ:
    Địa Chỉ: P. Hào Nam, Chợ Dừa, Đống Đa, Hà Nội, Việt Nam
    Điện Thoại: 0876318489
    Website: https://decorsanthuong.com/
    Email: decorsanthuong@gmail.com
    Social Media
    Twitter: https://twitter.com/decorsanthuong
    Reddit: https://www.reddit.com/user/decorsanthuong
    Linkedin: https://www.linkedin.com/in/decorsanthuong/
    Youtube: https://www.youtube.com/@decorsanthuong/about
    Twitch: https://www.twitch.tv/decorsanthuong/about


    thenexttech
    Participant

    ASP .NET CORE Charts Uncaught ReferenceError: $ is not defined” indicates a common issue encountered when attempting to utilize jQuery within an ASP .NET Core application. This error typically occurs when the jQuery library is not properly loaded or referenced in the project. To resolve this issue, ensure that the jQuery library is included and correctly referenced in the HTML file or layout view where the ASP .NET Core Charts are being implemented. You can do this by either adding a CDN link to the jQuery library or by including the jQuery script file locally in your project. Once jQuery is properly loaded, the “Uncaught ReferenceError: $ is not defined” error should be resolved, allowing you to successfully integrate ASP .NET Core Charts with jQuery functionality.
    FedEx operational delay
    Snapchat premium app
    Walmart call out number
    Apps like moneylion
    Best youtube video downloader


    noroj99012
    Member

    <p> </p>
    <hr />
    <h1>Hassle-Free Travel: Taking a Taxi from Heathrow to Central London and Whitechapel</h1>
    <p>Heathrow Airport is the main gateway for international travelers arriving in the UK. With its five busy terminals, navigating your onward journey from the airport can feel overwhelming. For those heading to Central London or specific areas like Whitechapel, choosing the right mode of transportation is essential for a smooth start to your trip. Taking a taxi from Heathrow to Central London or a taxi from Heathrow Airport to Whitechapel offers unmatched convenience, comfort, and peace of mind — especially after a long flight.</p>
    <h2>Why Choose a Taxi from Heathrow?</h2>
    <p>Heathrow is well connected by trains and buses, but there are many reasons why travelers prefer taking a taxi:</p>

    • <p>Door-to-door service: No need to navigate public transport with luggage.</p>
    • <p>Comfort and privacy: Enjoy a quiet ride in a private vehicle.</p>
    • <p>Time-saving: Ideal when arriving late at night or during peak hours.</p>
    • <p>Local drivers: Many taxi drivers know the best routes to avoid traffic delays.</p>

    <p>Whether you’re a tourist, a business traveler, <span data-sheets-root=”1″>Taxi from Heathrow Airport to Whitechapel </span> relaxing and direct journey to your destination.</p>
    <h2>Taking a Taxi from Heathrow to Central London</h2>
    <p>Central London is the heart of the city and includes areas such as Westminster, Covent Garden, Soho, and the City of London. The journey from Heathrow to Central London is around 15 to 20 miles depending on the specific location.</p>
    <p>A taxi from Heathrow to Central London typically takes 40 to 60 minutes, depending on traffic. This option is ideal if you’re heading to major hotels, government offices, conference centers, or iconic landmarks like Buckingham Palace, the Houses of Parliament, or the British Museum.</p>
    <p>Many travelers choose this option because:</p>

    • <p>It eliminates the need to change trains or deal with crowded public transport.</p>
    • <p>It’s more convenient when traveling with family or large groups.</p>
    • <p>Taxis can be pre-booked or picked up directly at any terminal’s official taxi rank.</p>

    <p>Although there are faster options like the Heathrow Express, a taxi offers unmatched convenience, particularly if your destination is not near a train station.</p>
    <h2>Traveling by Taxi from Heathrow Airport to Whitechapel</h2>
    <p>Whitechapel is a historic and vibrant district located in East London. Known for its cultural diversity, street markets, and art scene, it has become a popular destination for both visitors and locals. Whitechapel is also home to the Royal London Hospital and is close to commercial areas like Shoreditch and Liverpool Street.</p>
    <p>A taxi from Heathrow Airport to Whitechapel covers a distance of around 20 to 23 miles and usually takes between 50 minutes to 1 hour and 15 minutes, depending on the time of day and traffic.</p>
    <p>This option is especially useful if:</p>

    • <p>You are staying at a hotel or apartment in East London.</p>
    • <p>You have appointments at the hospital or nearby businesses.</p>
    • <p>You’re unfamiliar with London’s transit system and want a stress-free trip.</p>

    <p>Unlike Central London, which has several direct train routes from Heathrow, getting to Whitechapel by public transport often involves multiple changes. This makes a taxi a more straightforward and comfortable choice.</p>
    <h2>Tips for Booking a Taxi from Heathrow</h2>
    <p>Whether you’re heading to Central London or Whitechapel, here are a few tips to make your taxi journey smooth and hassle-free:</p>

    • <p>Book in advance for fixed pricing and guaranteed availability.</p>
    • <p>Check for meet-and-greet services where the driver meets you at arrivals with a name board.</p>
    • <p>Confirm flight tracking so the driver adjusts pickup time if your flight is delayed.</p>
    • <p>Choose the right vehicle size based on your luggage and group size.</p>
    • <p>Use licensed operators or official taxi ranks to ensure safety and reliability.</p>

    <p>Most taxi services <span data-sheets-root=”1″>Taxi from Heathrow to Central London </span>, making it easy to arrange transportation ahead of time.</p>
    <h2>Final Thoughts</h2>
    <p>Taking a taxi from Heathrow to Central London or a taxi from Heathrow Airport to Whitechapel is one of the most convenient ways to travel from the airport to your final destination. With comfort, direct routes, and door-to-door service, taxis remain a preferred choice for many travelers arriving in the UK. Whether you’re heading to the bustling city center or the cultural hub of East London, a taxi ensures you arrive refreshed and ready for what London has to offer.</p>
    <p> </p>

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.