0

while bundling the JS files, i came across the "Uncaught TypeError: Undefined is not a function". I researched in the internet but failed to find the solution. Can someone help me to find out what the problem is?. Here is the unminified JS file. The Error is showing in the below line of code exactly before 'live'.

live('click', function () 

the full js file code is like this

$(document).ready(function () {
    $('.login_link_bg').hover(function () {
        $('.login_hover_outer').fadeIn();
    }, function () {
        $('.login_hover_outer').fadeOut();

    });

    $('a.forgot_pass').click(function () {
        $('.forgot_pass_outer').slideToggle();
    });


    $(".popup_open").live('click', function () {
        var popup_name = $(this).attr("popup");

        var popheight = $(popup_name).height();
        var popWidth = $(popup_name).width();
        var pageWidth = $(document).width();
        var pageHeight = $(document).height();
        var left = (pageWidth - popWidth) / 2;
        $(popup_name).show(); $(".back-popup-layer").show();
        $(".back-popup-layer").css({ "height": pageHeight, "width": pageWidth });   

    });

    $('.close-btn').live('click',function(){
        $('.back-popup-layer').hide();
        $('.main_popup_outer').hide();  
    });

    $("#resend_activation_btn").click(function () {
        $('#spError2').hide();
        spError.innerHTML = "";
        $('input[id$=txtEmail]').val = "";
        $("#resend_activate_box").fadeToggle();
    });

    function toggle_visibility(id) {
        var e = document.getElementById(id);
        if (e.style.display == 'block')
            e.style.display = 'none';
        else
            e.style.display = 'block';
    }


});
Jonathan Lonowski
  • 121,453
  • 34
  • 200
  • 199
  • What version of jQuery are you using? [`.live()` was removed](http://api.jquery.com/category/removed/) from [1.9 and later](http://api.jquery.com/live/). – Jonathan Lonowski Jul 16 '14 at 17:27
  • am using V1.11.1, what i can do now instead? can you please suggest me – user3846077 Jul 16 '14 at 17:29
  • Use [`.on()`](http://api.jquery.com/on/) or [`.delegate()`](http://api.jquery.com/delegate) instead. The documentation for `.live()` [includes how to rewrite for them](http://api.jquery.com/live/#entry-longdesc) under "*Rewriting the .live() method in terms of its successors is straightforward [...]*" – Jonathan Lonowski Jul 16 '14 at 17:31

0 Answers0