Expand my Community achievements bar.

Join us on September 25th for a must-attend webinar featuring Adobe Experience Maker winner Anish Raul. Discover how leading enterprises are adopting AI into their workflows securely, responsibly, and at scale.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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...});