-1

I am using JQuery's getScript function to load scripts depending on the device type, to hope fully save on unnecessary requests and load time for mobile devices. I have this code currently:

<script type="text/javascript">
$(document).ready(function(){
    $.getScript('http://dev.imadeamerica.com/wp-content/themes/imadeamerica/js/mfc.js', function(){
        alert('It WORKED!');
    });
});
</script>

But it's not working, because I keep getting the error $(window)._scrollable is not a function. The only weird thing is that if you visit http://dev.imadeamerica.com/wp-content/themes/imadeamerica/js/mfc.js there is no call to that function. When I put a different script in the getScript function it works fine. But for some reason it thinks I am calling a function called $(window)._scrollable even though it's not present in that file.

I haven't found anything like this before and any help would be much appreciated.

Yahel
  • 37,023
  • 22
  • 103
  • 153

3 Answers3

1

Have the same issue when update bootstrap v4.0 to v4.3.1

Code example:

`https://codepen.io/pasha-oleynik/pen/yWvjaQ?editors=1011`

To fix need to use jquery without slim postfix. (use jquery-3.3.1.min.js instead of jquery-3.3.1.slim.min.js)

Pavlo Oliinyk
  • 380
  • 4
  • 10
1

The first line of setUp, line 27, has this:

$(window)._scrollable();

So, yes, you are calling that function.

Yahel
  • 37,023
  • 22
  • 103
  • 153
1

open your script and @ line no 27 you have a call $(window)._scrollable(); please define the function cz that functions is not defined

run
  • 1,170
  • 7
  • 14
  • I am such an idiot. I kept searching for the string in the text, but I had the settings wrong on the search, so notepad++ didn't find it. Thank you for looking. Sorry for wasting your time. – user1007356 Nov 11 '11 at 06:17
  • its ok. no issues!if you find relevent answser please upvote them all. thanks again – run Nov 11 '11 at 06:48