Handling “JQuery Is Not Defined” Error with RadControls For Windows 8 HTML

by Phil Japikse | Go comment!

When using the Telerik Windows 8 controls HTML in a Windows 8 Store project, you have to add the RadControls for Windows 8 HTML CSS and JavaScript references as described in this post.  For reference, the files are as shown in Listing 1.  I’ve shown using the dark theme.  If you prefer the light theme, the second CSS file would be “light.css”.

<!-- Telerik references --> 
<link href="/Telerik.UI/css/common.css" rel="stylesheet" /> 
<link href="/Telerik.UI/css/dark.css" rel="stylesheet" /> 
<script src="/Telerik.UI/js/jquery.js"></script> 
<script src="/Telerik.UI/js/ui.js"></script>
Listing 1 – Adding the Telerik References

The order of the JavaScript files matters, as the “ui.js” JavaScript depends on the “jquery.js” code to be loaded prior.  If you swap the order, you will get an unhandled exception stating “JQuery is not defined”.  The solution is easy – make sure you have the order listed as in Listing 1.

About the author

Philip Japikse

2012STLDODN.93x112 is an international speaker, a Microsoft MVP, INETA Community Champion, MCSD, CSM/ CSP, and a passionate member of the developer community, Phil has been working with .Net since the first betas, developing software for over 20 years, and heavily involved in the agile community since 2005. Phil works as a Developer Evangelist for Telerik's RadControls for Windows 8 as well as the Just family of products (JustCode, JustMock, JustTrace, and JustDecompile) and hosts the Hallway Conversations podcast (www.hallwayconversations.com). Phil is also the Lead Director for the Cincinnati .Net User’s Group (http://www.cinnug.org). You can follow Phil on twitter via www.twitter.com/skimedic read his Telerik blog at http://blogs.telerik.com/skimedic and his personal blog at www.skimedic.com/blog.

Posted in: windows-8 winrt winjs

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by Phil Japikse - or - read latest articles in Developer Tools