Anders Branderud
Anders Branderud

Reputation: 1918

Jquery, 'is not a function', extension-function not working

I get this error in the console of Firefox:

$spinner.setupSpinner is not a function
[Break On This Error]   

$spinner.setupSpinner();

ed247.base.js (line 116)

Postliste.aspx loads these files:

jquery-1.9.0.js"
jquery-ui-1.9.0.js
jquery.ui.datepicker-no.js
jquery-scrollTo-min.js
ed247.base.js

Excerpt of ed247.base.js :

    jQuery.fn.setupSpinner = function () {
        $(this)
            .ajaxStart(function () {
                $(this).show();
            })
            .ajaxStop(function () {
                $(this).hide();
            })
        ;
        return this;
    };

    // init
    function init() {
        // cache jquery objects
        $item = $(config.ids.item);
        $searchResult = $(config.ids.searchResult);
        $spinner = $(config.ids.spinner);
        $datepicker = $(config.ids.datepicker);
        $todatepicker = $(config.ids.todatepicker);
        $searchButton = $(config.ids.searchButton);
        $searchItemTemplate = $(config.templateids.searchItemTemplate);
        $searchHeaderTemplate = $(config.templateids.searchHeaderTemplate);
        $itemTemplate = $(config.templateids.itemTemplate);
        $attachmentsTemplate = $(config.templateids.attachmentsTemplate);
        $backLinks = $(config.classes.backLinks);
        $checkout = $(config.ids.checkout);


        $backToStep1 = $backLinks.find("li:nth-child(1)");
        $backToStep2 = $backLinks.find("li:nth-child(2)");

        $spinner.setupSpinner();

Here is the URL to the page: Link

The problem seems to be that the extension function isn't found? How do I solve this?

Upvotes: 0

Views: 236

Answers (1)

Guffa
Guffa

Reputation: 700780

You are loading the jQuery library twice. When you try to use the extension, it's not there any more, because you have replaced the jQuery object with a new one.

Upvotes: 1

Related Questions