Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript $ is not a function error

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #176292
    matthisco
    Participant

    HI folks,

    Getting this error for my js functions. I’m using noconflict. Any ideas how I can fix this?

    Here is the start of my file:

    
    // globals
    var recepients=Array();
    var groups=Array();
    var classes=Array();
    
    var grpnames=Array();
    var recnames=Array();
    var classnames=Array();
    
    var directorywindow;
    var total=0;
    
    jQuery.noConflict();
    jQuery(InitSite);
    
    // functions declared from here on
    function InitSite()
    { if(jQuery("#userfile").size())
       {
          jQuery("#userfile").MultiFile(
          {... etc 
    
    #176297
    matthisco
    Participant

    Tried this too but still get same error:

    $.noConflict();
    $(function() {... etc
    
    #176316
    brutalexcess
    Participant

    In your HTML file the first script you link should be jquery, then your javascript file, otherwise the browser will include your javascript file first and won’t understand what half the functions mean.

    Also, you should look at the official website for information on when to use the noConflict, because you may not need to do this unless your using other libraries using the same dollar sign alias.

    #177179
    matthisco
    Participant

    Thanks for the reply, i had conflicting scripts int he end

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.