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

$ is not defined - jQuery Intermittent Fire Fox error.

8 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
IQworks
Top achievements
Rank 1
IQworks asked on 25 Mar 2010, 07:41 PM
Hi,
     In fire fox when I run my grid the first time, it loads fine.
     if I hit the reload button, every once in a while I get this error in firebug and my grid shows up in the entire page, unformatted with a white backgroud ?
     
    " $ is not defined "

    I saw this post ... 

http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/error-when-using-jquery.aspx 

    And several others as i searched the web. However, none of them say anything about it being INTERMITTENT ?

  Dont know why the page is loading sometimes, but not always ?

  I have enclosed attatachments.

  Thanks for your advice

8 Answers, 1 is accepted

Sort by
0
IQworks
Top achievements
Rank 1
answered on 25 Mar 2010, 07:43 PM

Also, here is my master page with the scriptregistrar code ....

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>  
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> 
   <script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script> 
    <script src="../../Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script> 
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>    
    
<%= Html.Telerik().StyleSheetRegistrar()                         
.DefaultGroup(group => group.Add("Site.css")                                                    
.Add("telerik.common.css")   
.Add("telerik.hay.css")  
.Add("iqStandards.css")                                                     
.Combined(true)                                    
) %>   
 
</head> 
 
<body style="background-color:#352f85;">  
 
 
    <div class="page" style="margin-top:35px; " > 
   <!-- atcorners --> 
 
   <!-- btcorners --> 
        <div id="header"  >   
        <table width="100%" >   
        <tr>   
        <td style="border-width: 0px;" >    
         <div style="float:left;margin-bottom:0px;margin-Bottom:300; font-family: Tahoma;">  
                <label style="font-size: xx-large; padding-bottom:30;"><%=Resources.IqResource.Std_InformationQualityWorks%></label>   
            
            </div> 
            </td>   
            <td align="center" style="font-weight:bold;border-width: 0px;">  
            <div> 
            <%=Html.ActionLink(Resources.IqResource.Std_Version, "Revisions", "Home")%> 
            </div> 
            </td> 
            </tr> 
            <tr > 
                         
              
             <td style="border-width: 0px;">  
             <label style="font-size:large; padding-bottom:10;"><%=Resources.IqResource.Std_TelerikCodeLibContribution%></label>   
             </td> 
             <td style="border-width: 0px;">  
             <div>   
                <ul id="menu" > 
                      
                    <li><%= Html.ActionLink( Resources.IqResource.Std_Home , "Index", "Home")%></li>  
                    <li><%= Html.ActionLink(Resources.IqResource.Std_About, "About", "Home")%></li>  
                     <li><%= Html.ActionLink(Resources.IqResource.Std_Tooltips, "Index", "Tooltips")%></li>  
                </ul> 
                </div>   
              </td> 
             </tr> 
              
            </table> 
            
        </div> 
  <!-- tcorners --> 
             
  <!-- bcorners --> 
        <div id="main" > 
            <asp:ContentPlaceHolder ID="MainContent" runat="server" /> 
 
             
        </div> 
         <div id="footer" style="margin-top:10px;" > 
            </div> 
    </div> 
    <%= Html.Telerik().ScriptRegistrar()  
                   .DefaultGroup(group => group  
                   .Add("jquery.validate.js")  
                   .Add("telerik.common.js")  
                   .Add("telerik.grid.js")  
                   .Add("telerik.grid.filtering.js")  
                   .Add("telerik.datepicker.min.js")  
                   .Add("telerik.calendar.min.js"))   %>   
                     
                    
</body> 
 
   
</html> 
<style type="text/css">  
     
 
   
</style> 
   

Thanks again
0
Georgi Krustev
Telerik team
answered on 26 Mar 2010, 09:24 AM
Hi IQworks,

I noticed that you are registering twice jQuery.js file. Actually you are registering jquery-1.4.1.js and the scriptRegistrar is registering jquery-1.4.2.js. This is the reason why javascript error is thrown.

Please consider using jquery-1.4.2.js, which is registered by default. Nevertheless I will suggest you review this online help article which describes how to use WebAssets.

Regards,
Georgi Krustev
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.
0
IQworks
Top achievements
Rank 1
answered on 26 Mar 2010, 05:16 PM
Hi Georgi,
    I have a project currently with a support ticket - 294122 -
    I got a fix this morning that excludes all references to jquery-1.4.1, but unfortunatly,  now, instead of happening intermittenly, when I hit the tab to load the grid the first time, everything is fine, then, (at least the couple of times I tested it) when I hit the firefox reload and try the tab again, it errors out with the information I provided in my last post. 
    Even though I got the fix this A.M. about the 294122, I am sending a copy back for the following issue .... 
http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/potential-problem-with-jquery-1-4-2-included-in-telerik-web-ui-common-jquery-js.aspx
 So I guess this is a chance for you to see the firefox error first hand ? Or, I could copy that problem and make another ticket ?
   However, I will read the web assests link you sent.
thanks
0
IQworks
Top achievements
Rank 1
answered on 26 Mar 2010, 06:44 PM
Hi Atanas,
   I reviewed the web assets. Yep, thats what I need to do.
   The caching concerns me though, I guess the browser knows to replace the previously cached version if a new script file with the same name has been modified ?
   Will apply these for my next upload to my code library project - hate bothering you with that.
thanks again.
0
IQworks
Top achievements
Rank 1
answered on 30 Mar 2010, 06:30 PM
Hi,
     Sorry, the last post was to confirm that in fact, I did need to use some web assests. 
     It was not to confirm that the "$ is not defined" problem was fixed.
   
     I was instructed to eliminate the cross jquery-1.4.1 and 1.4.2 scripts, but unfortunately, this did not eliminate the 
problem.     

     I will open up a seperate ticket for this rather than confuse things by referencing this problem in another ticket. 
     This new ticket is 295509.  

Thanks again.     
0
IQworks
Top achievements
Rank 1
answered on 08 Apr 2010, 12:39 PM
Hi,
    The Telerik support team found the answer to this issue. I applied the fix. It not only got rid of my problem, but some of my page navigation worked faster as well. I am posting this answer for anyone else who may run into this problem. 
    
http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx     

Fixing Firefox Slowness with localhost on Vista (or XP with IPv6)

I've been doing a lot of cross-browser testing lately for AJAX applications and Firefox has been killing me since it takes several seconds to load a single page when using localhost URLs on Windows Vista.  Internet Explorer 7 and Safari have been blazing fast with the same pages so I finally took the time to research the issue with Firefox and came across the following information: 

http://kb.mozillazine.org/Network.dns.disableIPv6

It turns out that the slowness is caused by an IPv6 issue with DNS and can easily be resolved by turning IPv6 support off in Firefox while doing localhost testing.  To make the change, type about:config in the address bar, locate the network.dns.disableIPv6 setting and double-click on it to set it to true.  This does the trick for the Firefox localhost issue on Vista and everything is running fast again.

  Thanks again to Telerik support

0
Varun
Top achievements
Rank 1
answered on 13 Jun 2011, 06:59 PM
Hi,
 I am having the same problem. Can someone tell what was the proposed solution to the actual problem?

Thanks
0
Dimo
Telerik team
answered on 14 Jun 2011, 06:27 AM
Hello Varun,

The problem in David's case and our suggestion was the following:

===
You are actually clicking on the tab before the page loads. This happens because the page loads very slowly - it's a known problem between Firefox and the ASP.NET development server. While you can fix it through changing a Firefox property by following these steps (and I recommend that you do so, it will speed up your development time), the issue is clear - the tabs navigate if one clicks them before the page loads. The JavaScript error is then caused because only the partial view is rendered (and the scripts from the master page are not). We will look deeper into the problem and fix it, thank you for pointing it out.
===

All the best,
Dimo
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
Grid
Asked by
IQworks
Top achievements
Rank 1
Answers by
IQworks
Top achievements
Rank 1
Georgi Krustev
Telerik team
Varun
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or