1

I am getting type error in jquery , please help me

TypeError: $(...).msDropDown is not a function

$("#time_zone").msDropDown();

replace $ by jQuery but same error occure

 $(document).ready(function(arg) {
     $("#time_zone").msDropDown();
     $("#time_zone").hide();
 });
5
  • What are you trying to achieve? Which browser are you using? Why do you think msDropDown should exist? Jan 5, 2015 at 7:43
  • Did you include the script src for it? Jan 5, 2015 at 7:45
  • Because DOM elements do not have a .msDropDown() method. If you are using a library please say so Jan 5, 2015 at 7:45
  • there are a number of different reasons this can occur. Loading jQuery more than once, forgetting to load plugin file or bad path to plugin file, noConflict being used in page (very common in wordpress and other CMS's), incorrect code loading order. You need to isolate these issues and gather as much detail as you can
    – charlietfl
    Jan 5, 2015 at 8:08
  • yes i m forgetting to include jquery.dd.js file where msDropDown() is declare so this type of error occured.. now I m including, no error occured
    – user3481196
    Jan 5, 2015 at 8:29

1 Answer 1

0

I think you are using an external js file for dropdown right ? If So that error is due to not including your js file . You should call your external js above just or above your code snippet.

eg:-

<script src="<?php echo base_url();?>javascripts/msDropDown.js"></script>

then your code comes below

$(document).ready(function(arg) {
     $("#time_zone").msDropDown();
     $("#time_zone").hide();
 });

Hope this helps you !! thank you

1
  • yes only one possibilities,but he could try atleast this suggestion too Jan 5, 2015 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.