Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #15138


    I added a new jquery framework to display confirmation messages in the choices theme and I get an error

    Here is the script that I added (to reproduce the problem)


    $.confirm = function(){



    $.confirm.hide = function(){

    alert(‘confirm hide’);



    Each time I call $.confirm() I get an error that the confirm method does not exist.

    If I remove the references to

    <script type=’text/javascript’ src=’/Content/themes/choices/js/avia.js’></script>

    <script type=”text/javascript” src=”Content/themes/choices/js/avia_styleswitch.js”></script>

    My confirm method works just fine.

    So my guess is that the avia framework does something to jquery, so that other components cannot register extension methods

    Do you know what it might be ?

    If the question is not clear, I will try to elaborate, let me know.

    Thank you,

    Andrei Gavrila


    Hi Andrei Gavrila,

    I’m not sure how to fix it. Let me tag Peter to check this issue. :)




    1) Try following code instead:

    $.fn.alertconfirm = function(options){

    var defaults = {
    hide: false

    var options = $.extend(defaults, options);

    if(options.hide == true)
    alert('confirm hide');

    You should be able to call the alert box with following code now:

    jQuery('a').on( 'click', alertconfirm({ hide: false }) );


    jQuery('a').on( 'click', alertconfirm({ hide: true }) );

    Update: I think this is not a clever solution anyway because there’s already a default confirm() function in js. Thus you can create the same effect with eg following code:

    function confirmcheck()
    var answer = confirm("Do you really want to hide the element?");
    if (answer){
    return true;
    return false;


    and call this function like:

    jQuery('a').on( 'click', confirmcheck() );


    Thanks for the input.

    We also have some problems when using $ instead of jQuery.

    Could you please tell me if you know why ?

    This call works: jQuery('video,audio').mediaelementplayer(/* Options */);

    This one returns an error: $('video,audio').mediaelementplayer(/* Options */);

    The error message is Uncaught TypeError: Property ‘$’ of object [object Window] is not a function.

    If we remove the references to

    <script type='text/javascript' src='/Content/themes/choices/js/avia.js'></script>
    <script type="text/javascript" src="Content/themes/choices/js/avia_styleswitch.js"></script>

    $ works properly.

    Could you please tell me why this happens. We are pretty concerned now on using the avia framework, since other frameworks that we use might use $ and might get broken.

    Thank you



    Yes, the reason is that Kriesi uses the noconflict mode:

    Best regards,


Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Choices jquery error’ is closed to new replies.