none
Microsoft JScript runtime error: 'jQuery' is undefined

    Question

  • hi i am getting error Microsoft JScript runtime error :'JQuery' is undefined when i run the below code. I have included .js file in header but still it cant see the file any suggestions please?

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="StandardSite" %>
    <%@ Import Namespace="BlogEngine.Core" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head runat="server" profile="http://gmpg.org/xfn/11">
        <link rel="stylesheet" href="style.css" type="text/css" />
        <link rel="shortcut icon" href="~/pics/blogengine.ico" type="image/x-icon"/>
        <script src="~/Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>

        <script src="~/Scripts/jqFancyTransitions.1.8.min.js" type="text/javascript"></script>
        
        
    </head>
    <body>
    <div id='slideshowHolder'>
     <img src='img1.jpg' alt='img1' />
     <a href ='http://workshop.rs'/></a>
     <img src='img2.jpg' alt='img2' />
     <a href ='http://workshop.rs/projects/jqbargraph'></a>
     <img src='img3.jpg' alt='img3' />
     <a href ='http://workshop.rs/projects/moobargraph'></a>
    </div>
    <script>
        $(document).ready(function () {
            $('#slideshowHolder').jqFancyTransitions({ width: 400, height: 300 });
        });
    </script>
      <div id="header">
        <p><a href="<%=Utils.AbsoluteWebRoot %>"><%=BlogSettings.Instance.Name %></a></p>
        <span><%=BlogSettings.Instance.Description %></span>
      </div>

      
      <div id="menu">
        
        <div class="login">
             <span runat="server" id="aUser"></span><a runat="server" id="aLogin" />
        </div>

       
        <ul>
          <li><a href="<%=Utils.AbsoluteWebRoot %>" rel="home"><%=Resources.labels.home %></a></li>
          <li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
          <li><a href="<%=Utils.AbsoluteWebRoot %>contact.aspx"><%=Resources.labels.contact %></a></li>
          <li><a href="<%=Utils.FeedUrl %>" class="feed"><img src="<%=Utils.AbsoluteWebRoot %>pics/rssButton.gif" alt="Feed" /><%=Resources.labels.subscribe %></a></li>
          <li><a href="javascript:void(BlogEngine.filterByAPML())" class="apmlfilter"><%=Resources.labels.filterByApml %></a></li>
        </ul>
      </div>
      
      <form runat="Server" class="body">
        
        <div id="content">
          <blog:SearchOnSearch runat="server" MaxResults="3" Headline="You searched for" Text="Here are some results for the search term on this website" />
          <asp:ContentPlaceHolder ID="cphBody" runat="server" />
          
          <p id="footer">
            Powered by <a href="http://www.dotnetblogengine.net">BlogEngine.NET</a> <%=BlogSettings.Instance.Version() %><br />
            Theme by <a href="http://blog.madskristensen.dk">Mads Kristensen</a>
          </p>
        </div>

        <div id="sidepanel">
          <blog:WidgetZone runat="server" ZoneName="be_WIDGET_ZONE" />
        </div>
        
      </form>
      
    </body>
    </html>

    satwick




    • Edited by satwick Thursday, May 17, 2012 7:10 PM
    Tuesday, May 01, 2012 10:53 PM

Answers

  • Hi,

    I believe your reference is correct. Just for the cross check open IE developer toolbar(f12 sort-cut) and click on Script Tab and select your both the scripts file is loaded(should not give 404 file not found message in right side panel)

    One more thing, this is master page, can you check whether any other jquery reference is added to the content page?


    • Marked as answer by satwick Sunday, July 01, 2012 4:16 PM
    Tuesday, May 22, 2012 10:19 AM

All replies

  • Hi,

      In the project, delete all references to jqueryX.X.js files and install the latest version of them. After that, you won't need to reference them. It worked for me.

      Regards,

    MARIO

    Tuesday, May 08, 2012 3:53 PM
  • Try to remove one of these jquery reference below:

    <script src="~/Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="~/Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>

    
    Wednesday, May 16, 2012 8:12 AM
  • Hi satwick,

    I would recommend the following steps to check the same

    1) remove this     <script src="~/Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>

    2) <script src="http://servername/Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>  -> some times the relaitive url was not correct, would prefer to give absoulute to find out whether this is the cause of the issue.

    3) Move the <script src="http://servername/Scripts/jquery-1.2.6.min.js" type="text/javascript"></script> below the body tag.

    PLease let me know if this works or still the issue persists.

    Thursday, May 17, 2012 4:52 AM
  • I have removed one reference and downloaded latest .JS file still cant get it done? Any more suggestions please??

    satwick


    • Edited by satwick Thursday, May 17, 2012 7:21 PM
    Thursday, May 17, 2012 7:12 PM
  • Hi,

    I believe your reference is correct. Just for the cross check open IE developer toolbar(f12 sort-cut) and click on Script Tab and select your both the scripts file is loaded(should not give 404 file not found message in right side panel)

    One more thing, this is master page, can you check whether any other jquery reference is added to the content page?


    • Marked as answer by satwick Sunday, July 01, 2012 4:16 PM
    Tuesday, May 22, 2012 10:19 AM
  • check your master page you may be referencing a different version of the file, from what you have in your /Script folder
    Friday, November 02, 2012 2:59 PM
  • พี่คะ ใช้ tool อะไรในการ run  jquery นี้คะ
    Saturday, January 25, 2014 12:08 PM