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

jQuery: undefined

1 Answer 265 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tomasz M.Lipiński
Top achievements
Rank 1
Tomasz M.Lipiński asked on 02 Oct 2010, 06:28 AM
Hi,

I'm a lamer for sure :-) but:
there is a following declaration on my .aspx page:
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true">
    <Scripts>
....
      <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
      </asp:ScriptReference>
....
    </Scripts>
  </telerik:RadScriptManager>

But when I try to do something with jQuery, the jQuery object is undefined. What should I do to be able to use it?

Regards
Tomasz

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 04 Oct 2010, 08:39 AM
Hello Tomasz M.LipiƄski,

The first step, when including the jQuery script library that is embedded in Telerik.Web.UI, is to add a ScriptReference pointing to Core.js as we use a slightly customized version of jQuery which depends on Core.js. We have not modified the implementation of jQuery in any way. We have just appended a few more lines of JavaScript at the end of the file in order to avoid any version conflict and to include a few useful jQuery plugins.

After including the jQuery file you can start using it. However, the jQuery object is available as $telerik.$ instead of the default $ or jQuery aliases. This is so to avoid compatibility issues with applications which already use (other versions of) jQuery. That is why, in order to use the default aliases, you need to include another script reference:

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" >
   <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>

Additional information is available in the Using jQuery topic of our documentation - http://www.telerik.com/help/aspnet-ajax/using-jquery.html.

Regards,
Tsvetie
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Tomasz M.Lipiński
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or