Click here to Skip to main content
15,891,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

Need your help,

After buildsucceed Whenever i click f5 the page giving the error like "Javascript runtime error; 'jQuery' is undefined"

please find below my code, error have in line else if (typeof jQuery.ui == 'undefined')

JavaScript
TSC.Timeout.Timeout.prototype =
{
    initialize: function() {
        TSC.Timeout.Timeout.callBaseMethod(this, 'initialize');

        // async postback support to reset session
        if (this._resetSessionOnAsyncPostback)
            Sys.Application.add_load(Function.createDelegate(this, this._handlePageLoaded));
        else
            this._resetTimeout();

        // respect displayButton
        if (this._displayButton) {
            this._onclickHandler = Function.createDelegate(this, this._onClick);
            $addHandler($get(this._btnClientId), "click", this._onClick);
        }
        else if (typeof jQuery.ui == 'undefined') {   // if no jquery ui, clicking div will reset - otherwise must click jquery ui modal button
            this._onclickHandler = Function.createDelegate(this, this._onClick);
            $addHandler($get(this._clientId), "click", this._onClick);
        }

        this.initDialog();
    },


url path of this file is WebResource_2.axd?d=LGHQ91z4LixL01jNAlgwZL99pE7TNlpZufa1JfgfLoiCZRLgGKDl2eWTfcSl6zd9U4eqHJ-sD39qv1slbjytuuYSRTs5h53oHJZ4IBjBAlyXdh3NVAAO9leC61obTDIh0&t=635659264390659079

kindly please share your ideas with me, it's more useful now

advance thanks :)

Best Regards
G.Renga
Posted

1 solution

Check for presence of global variable jQuery first, before checking for jQuery.ui, like so ...

C#
else if (typeof jQuery == 'undefined' || typeof jQuery.ui == 'undefined'){ ... }


shorthand version that should be work as well is

else if (jQuery && jQuery.ui){ ... }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900