Working with JavaScript in Visual Studios

Hi I have following JavaScript code. When I run it in Visual Studio I get error.

Code is

    <script src="js/jquery.easing.1.2.js"></script> 
   <script src="js/jquery.anythingslider.min.js"></script> 
   <script> 
      $(function() {
          $('#home-slider').anythingSlider({

              .....
          });
      });   
   </script>

It gives error at $(function() {
Saying 

Unhandled exception at line 194, column 7 in http://localhost:56192/main/home.aspx

0x800a1391 - JavaScript runtime error: '$' is undefined

Any ideas what am I doing wrong or to fix it? Thanks

Answers:

Answer

Sounds like you have forgotten to include the jQuery library itself.

You need something like:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.