We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Resolving jQuery multiple references error

The error Uncaught TypeError: $(...).ej< component > is not a function arises when referring to the JQuery scripts multiple times in the corresponding web application or when jQuery script files are referred to after the Syncfusion script files, ej.web.all.min.js and ej.webform.js.min. The following screenshot shows the error occurs in the dialog component.

 

Figure 1: Uncaught TypeError: $(...).ejDialog is not a function error

 

To overcome this error, refer to the jQuery scripts in the application only once or refer to the Syncfusion specific script files after the jQuery file reference. The following are the solutions:

 

Solution 1

 

Create a web application in Visual Studio and the jQuery scripts configure automatically in the ScriptManager section. In case of using the script, references generated from the VS project creation under ScriptManager, add the manual references to other dependent scripts for rendering control after the jQuery base reference.

Syncfusion has added references to the required files in the Site.Master page under the ScriptManager. Refer to the following code:

 

Site.Master

 

 

Solution 2

 

Add the Syncfusion scripts and jQuery scripts in bundle configuration in the App_Start folder and refer to the bundles in the Site.Master page. Refer to the following code for bundleconfig and references.

 

BundleConfig.cs

 

 

SiteMaster

 

 

Note:

Make sure that there are no other references for jQuery file and Syncfusion script files in any other pages. Use these dependent scripts on SiteMaster page.

 

In case the requirement is to refer on individual pages, make sure that there is no conflict of multiple references when the page loads. By default, when creating an application or website using Visual Studio the script reference for jQuery file will be added in the ScriptManager.

 

This solution is applicable for both ASP.NET WebForms and ASP.NET MVC.

Article ID: Published Date: Last Revised Date: Platform: Control:
4872 05/13/2015 08/27/2018 ASP.NET Web Forms General
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.