This is a migrated thread and some comments may be shown as answers.

Using external Jquery in release .1111

14 Answers 223 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stein
Top achievements
Rank 1
Stein asked on 17 Nov 2015, 10:43 AM

There seems to be a problem loading jquery 1.11.3 in the new release .1111.

2015.3.930.40 works fine. 2015.3.1111.40 will generate the "JQuery not defined"-error

Is this by design? Have tried disabling the embedded jquery as well, without luck so far.

14 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 20 Nov 2015, 06:31 AM
Hi Stein,

Can you please provide a markup example of the scenario? How jQuery is being loaded?

You can also follow these articles and see if they can help you resolve the problem:

Regards,

Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stein
Top achievements
Rank 1
answered on 20 Nov 2015, 08:10 AM

<%@ Page .........%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.w3.org/1999/xhtml
                          http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
<head id="Head1" runat="server">
    <title>.....</title>
    <script src="Scripts/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="Styles/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.Jcrop.js" type="text/javascript"></script>
    <link rel="stylesheet" href="Scripts/jquery.Jcrop.css" type="text/css" />
    <link id="link_bootstrap" href="~/Styles/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        jQuery(function ($) {
            StartJCrop();
        });

 

 ......

 

<body class="cropWin" onload="AutoSizeIt();">
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        </Scripts>
    </telerik:RadScriptManager>

0
Ianko
Telerik team
answered on 23 Nov 2015, 09:15 AM
Hi Stein,

I suggest you following the approaches suggested in the articles sent. 

By adding the jQuery references in the head element, the internal jQuery of Telerik.Web.UI fails and thus, causes the JavaScript error to be thrown. Overriding the internal jQuery (which is the result of the code implement) is not supported and it is very likely to cause more issues with out controls. 

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stein
Top achievements
Rank 1
answered on 23 Nov 2015, 09:59 AM

This must've changed in the .1111-release since it's working fine in earlier builds.

I've tried to do both scenarios (without any luck):

* using the jquery in the head (as today) and disabling the jquery by using the EnableEmbeddedJquery=false (without any luck)

* removing the jquery in the head and using the Telerik-version with the instructions provided.

 

0
Ianko
Telerik team
answered on 23 Nov 2015, 11:51 AM
Hi,

Running this code locally runs fine with the built-in jQuery:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
    </Scripts>
</telerik:RadScriptManager>
 
<script>
    jQuery(function ($) {
        alert(1);
    });
</script>
 

It would be easier for me to understand the situation encountered on your end by providing me a runnable code, example or project which I will be able to locally investigate and help you further.


With .1111 version there is only an additional dependency regarding the Detection framework. Due to which the Detection.js should be added before Core.js:
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Detection.Detection.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />

Although, this should throw a different error. 

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Lorena
Top achievements
Rank 1
answered on 23 Nov 2015, 06:29 PM

Hi,

I have the same problem, do not understand why the need for this change. 

I updated the latest version of Telerik ASP NET AJAX (Q3 2015.3.1111.40) but now I have problems because it does not recognize "jquery", the browser shows me "Uncaught ReferenceError: $ is not defined". Every time there is a new version of Telerik always update my application references. Until version "Q3 2015.3.930.40" I have not had this kind of problem but now with the latest version of Telerik have this big problem.

 I applied suggesting Lanko:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Detection.Detection.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>

But now it shows me more mistakes, and not only with "jQuery" also with "jQuery UI."

- "Uncaught ReferenceError: $ is not defined".
- "Uncaught TypeError: $(...).draggable is not a function"

I need a quick solution please. Thank you.

 

0
Ianko
Telerik team
answered on 24 Nov 2015, 08:10 AM
Hello Lorena,

I tried to reproduce the same problem locally, but to no avail. Even without the Detection framework referenced, everything works as expected on my end:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        <asp:ScriptReference Path="//code.jquery.com/ui/1.11.1/jquery-ui.js" />
    </Scripts>
</telerik:RadScriptManager>

As you can see, I have also referenced the jQuery-UI script in order to have the draggable widget.

You can find attached a sample ASP.NET page that shows the test case done on my end. If there is something additional that I should be aware of, that would lead the same error, please do let me know.

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Arnstein
Top achievements
Rank 2
answered on 24 Nov 2015, 10:11 AM

I can also confirm that this behavior is new in version 2015.3.1111. I have a large project that has been in production for several years. jQuery is included using a standard <script src=””… include. I know that this is not in accordance with the current documentation, but it has worked flawlessly during numerous versions of Telerik UI for ASP.NET AJAX, until version 2015.3.1111.

This may not be a bug, but it is a rather critical change and in my opinion it should have been documented (in the release notes).

Regards,

Arnstein

0
Ianko
Telerik team
answered on 24 Nov 2015, 11:54 AM
Hi Arnstein,

At the moment, I am not aware of any changes regarding the mechanism for including jQuery or ones related to its internal usage that could be documented or announced somewhere. Or ones that may lead to the behavior described in this forum thread.

The previous statement about the Detection framework is only a suggestion for a fix, but it is relevant only if Telerik.Web.UI is built in debug mode. Which I assume is not the case here. 

If the scenario described works properly by following the recommendations available in the documentation, every other option is officially unsupported and it is expected to cause issues. The main reason for that is because using jQuery as external library overrides the one that comes with Telerik.Web.UI. Thus, any functionality in the controls designed based on the version of the internal jQuery is not actual. And further, incompatibility issues are expected. 

It will be greatly appreciated if you can provide a markup example that shows the issue and it is one that is properly supported, so that I can examine it further. 

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ianko
Telerik team
answered on 27 Nov 2015, 07:32 AM
Hi,

After some further research, the described behavior might be related to RadStyleSheet manager.

If you are using it with the pages where the jQuery references are used, the script tags in the head element might be reordered due to a bug.

To test that for sure, you can download the LIB version of the Telerik.Web.UI and test if the jQuery-related issues are resolved. If this is the case with the issues described in this forum thread, then I suggest you waiting for the upcoming official release (2016 Q1) and upgrade to it. 

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stein
Top achievements
Rank 1
answered on 27 Nov 2015, 11:12 AM

I'm unable to use the latest internal build(downloaded and added .1124 as referenced-dlls instead of the existing one - build .930).

VS.NET 2013 gives me the following error:

Error139'Could not load file or assembly 'Telerik.Web.UI, Version=2015.3.930.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)'F:\Dev2013\.......\LC

 

3>LC : error LC0000: 'Could not load file or assembly 'Telerik.Web.UI, Version=2015.3.930.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)'



0
Marin Bratanov
Telerik team
answered on 27 Nov 2015, 04:47 PM

Hello Stein,

I advise you try the following:


Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jan
Top achievements
Rank 1
answered on 04 Dec 2015, 09:53 AM

Hi, this problem also exists without using stylesheetmanager.

 

As soon as there is a control that is using the radscriptmanager the problem occurs.

I have this code in head:

   

<head runat="server">
 <!--[if IE 7]>
    <link href="/Design/Common/IE7.css" rel="stylesheet" type="text/css" runat="server" id="cssIE7"/>
    <![endif]-->
</head>

The rendered html move the link href up:

<head>
<link href="/Design/Common/IE7.css" rel="stylesheet" type="text/css" runat="server" id="cssIE7"/>
 <!--[if IE 7]>
    <![endif]-->
</head>

 

This destroys our design completely.

0
Nencho
Telerik team
answered on 04 Dec 2015, 12:26 PM
Hello Jan,

The experienced issue is probably caused by a fix that we have implemented for that version. I would suggest you to download our latest internal build, where the implementation is reverted, and test the behavior again. If the behavior is the proper one, I would suggest upgrading to our upcoming official release, scheduled for Jan 13, 2016.

Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Stein
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Stein
Top achievements
Rank 1
Lorena
Top achievements
Rank 1
Arnstein
Top achievements
Rank 2
Marin Bratanov
Telerik team
Jan
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or