Solved

ASP.net Javascript Slider Error

Posted on 2014-04-11
2
373 Views
Last Modified: 2014-04-13
Hi
I implemented a Javasript slider with the code below on my site www.leadershipsurvey.co.za
Now when I put the code below in a new site  I get the error shown in the image

1
       
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('.slider img:gt(0)').hide();
            setInterval(function () { $('.slider :first-child').fadeOut(2000).next('img').fadeIn(2000).end().appendTo('.slider'); }, 5000); /*5 sec*/
        });
    </script>
    <style type="text/css">
	.slider { clear:both; position:relative; height:240px; width:950px; }
	.slider img { position:absolute; left:0; top:0;cursor:pointer; }
    </style>


    <div class="slider" style="margin:0 auto;">
        <img src="Images_Slide2/1.jpg" />
        <img src="Images_Slide2/2.jpg" />
        <img src="Images_Slide2/3.jpg" />
        <img src="Images_Slide2/4.jpg" />
        <img src="Images_Slide2/5.jpg" />
        <img src="Images_Slide2/6.jpg" />
        <img src="Images_Slide2/7.jpg" />
        <img src="Images_Slide2/8.jpg" />
        <img src="Images_Slide2/9.jpg" />
        <img src="Images_Slide2/10.jpg" />
    </div>

Open in new window

0
Comment
Question by:murbro
2 Comments
 
LVL 18

Accepted Solution

by:
Gary Davis earned 500 total points
ID: 39996697
I went to your site and see the code and it does not get the JavaScript error you show.

When "$" is undefined, it generally means the jQuery has not been pulled in with the <script> tag prior to its use but in your case, it is via the CDN.

It is possible if your page is displayed as https and your script pulls in jQuery with http you may not get the script, but this does not appear to be your issue.

Gary Davis
0
 

Author Closing Comment

by:murbro
ID: 39997294
Thanks
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question