1

We have a web site which is open to public customers. They are complaining a button is not working (on IE as reported so far). But we cannot regenerate in dev environment or even live site. The button is calling a jquery method but it seems it doesn't even hit the method when this issue occur.

Below is the method the button should fire but nothing reported in our logs as coded.

function getAddress() {
if ($('#postcode').val() == "") {
    $('#postcode').addClass("txt_required");
    return false;
}
else {
    $.post(serverPath + "IsSessionAlive", { policyRefNo: refNo }, function (data) {
        if (data.Session == 1) {                
            $.ajax({
                type: 'POST',
                url: serverPath + "GetPostcodeRelatedAddress",
                dataType: 'json',
                data: { code: $("#postcode").val() }
            })
            .done(function (data) {
                try {                    
                    //console.log(data);
                    $("#postcode").val(data.postcode);
                    $("#address2").val(data.address2);
                    $("#town").val(data.town);
                    $("#city").val(data.city);

                    var prems = data.premises;

                    $('#address1').empty();
                    for (i = 0; i <= prems.length - 1; i++) {
                        $('<option/>').val(prems[i]).html(prems[i]).appendTo('#address1');
                    }
                } catch (e) {
                    window.location.replace(serverPath + "Error?errcode=" + e.toString());
                }
            })
            .fail(function (data) {
                window.location.replace(serverPath + "Error?errcode=ajax fail");
            });
        }
        else {
            window.location.replace(serverPath + "SessionTimeOut");
        }
    });
}

My question here is what are the available approaches to catch these types of issues which devs cannot see but some unknown users are reporting they really exists?

kapz
  • 437
  • 1
  • 7
  • 15
  • What version of IE is having the problem, and how is `getAddress()` called? – Rory McCrossan Sep 21 '15 at 12:14
  • Have you done cross browser testing? If you can't set up a machine with the appropriate browsers on it, there are a number of services out there that you can spin up a browser on a VM and try it (e.g. browserstack). – Paddy Sep 21 '15 at 12:18

1 Answers1

0

I faced type this scenario in my time.

We have integrate our page to customer sites. on that some user reports our button click not working.

Remedy we take after

  • Defined global javascript error catch. Be sure this will load first.

    <script type="text/javascript">
    window.onerror = function(msg, url, line, col, error) {      
      //Log;
    };
    </script>
    

    If any javascript error occurs before your button click script, That script will load but defintly your button click will not bind.

  • Then check your button click event binded or not by using $._data.

    ​$._data( $("#button_id")[0], "events" );
    

    Ref : https://stackoverflow.com/a/2008622.

  • If global error catch find your error means , check its affecting your button click.

This was i faced and get rid off.

Community
  • 1
  • 1
Andi AR
  • 2,678
  • 2
  • 23
  • 28