Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery is undefined on page refresh
    primarykey
    data
    text
    <p>I don't think this issue has been raised anywhere else but please correct me if I'm wrong. </p> <p>I'm using a beautiful piece of javascript code that I found on the net for adding an image slideshow on a page. I've added it to an ASP.NET page and it works fine, the images are displayed correctly at the appropriate intervals. However, the problem is that whenever I refresh the page (F5 or the 'refresh' button on the address bar, I'm testing on IE9, by the way), this error message appears: Line: 17 Error: 'jQuery' is undefined </p> <p>followed by: Line:44 Error: The value of the property 'jQuery' is null or undefined, not a Function object.</p> <p>When I go to another page and click the Back button, the slideshow also works perfectly. It seems that the problem only occurs on page refresh.</p> <p>Here is the code within the ASP header content tags:</p> <pre><code> &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="Scripts/fadeslideshow.js"&gt;&lt;/script&gt; </code></pre> <p>The code for the slideshow has been taken from "Dynamic Drive" (Ultimate Fade In Slideshow v2.0) <a href="http://www.dynamicdrive.com/" rel="nofollow">http://www.dynamicdrive.com/</a></p> <p>I've tried moving the javascript references to the bottom section within the ASP body content tags just in case the error has something to do with the order in which the javascript is being called when the page load. Although I really have little idea and am a bit stuck at the moment. Any help is appreciated.</p> <p>Code for ASP.NET page:</p> <pre><code>&lt;%@ Page Title="Community Support" Language="VB" MasterPageFile="~/Main.Master" AutoEventWireup="false" CodeFile="Copy of CommunitySupport.aspx.vb" Inherits="CommunitySupport" %&gt; &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="Scripts/fadeslideshow.js"&gt; /*********************************************** * Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ &lt;/script&gt; &lt;script type="text/javascript"&gt; var defaultPhoto1 = new String(""); var defaultPhoto2 = new String(""); var defaultCaption1 = new String(""); var defaultCaption2 = new String(""); defaultCaption1 = "caption A"; defaultCaption2 = "caption B"; defaultPhoto1 = "Images/photo1.png"; defaultPhoto2 = "Images/photo2.png"; function getSlideShowImages() { var mygallery = new fadeSlideShow({ wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow dimensions: [320, 220], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ [defaultPhoto1, "", "", defaultCaption1], [defaultPhoto2, "", "", defaultCaption2] ] //&lt;--no trailing comma after very last image element! , displaymode: { type: 'auto', pause: 2500, cycles: 0, wraparound: false }, persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "ondemand", togglerid: "" }) } &lt;/script&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; &lt;asp:HiddenField ID="hidSlideShow" runat="server"/&gt; &lt;asp:HiddenField ID="hidCaptions" runat="server"/&gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;td width="60%" valign="top"&gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;td width="100%" valign="bottom" class="heading1"&gt;Title &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="100%"&gt;&lt;br /&gt;Content &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;td width="40%" valign="top"&gt; &lt;div id="fadeshow1" class="slideDiv"&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p></p> <p>The "fadeshow1" div is where the slideshow is being displayed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload