Expand my Community achievements bar.

Duplicate network calls

Avatar

Level 1

Hi 

 

I have implemented Twitter pixels through launch which are base code and event code and I see there are duplicate calls in browser network which is supposed to be two.

eci-3 and eci-4 but they are duplicate. Any help.

Regards

Anwar

 

 

duplicate.png

1 Reply

Avatar

Level 5

Post the code of the object you are clicking on, and the event that is firing twice. Usually this is caused by declaring it in the OnClick event, as well as Handles Something.click in the even prodecdure.

 

You have something outside the example triggering another .click(), check for other handlers that are also triggering a click event on that element.

 

$('selected').unbind('click').bind('click', function (e) {
  do_something();
});

Strange behaviour which I was experienced also. So for me "return false" did the trick.

$( '#selector' ).on( 'click', function() {
    //code
    return false;
});

 You can also try with different methods,

 

 $('#id').off().on('click', function() {
        // function body
    });
    $('.class').off().on('click', function() {
        // function body
    });

 

$('.class').on('click', function () {...your codes...});

$(document).on('click','.class', function () {...your codes...});