Expand my Community achievements bar.

How to abort alloy "sendEvent" request(s)

Avatar

Level 3

Hi all, I have a situation where the activity map is being trigger when a visitor interacts with the navigation menu. ie menu opening up / showing sub menus. These are the links which have the following href="javascript:void(0);"

 

I would simply want to abort or cancel "sendEvent" requests programmatically (using example code snippets below). Now, the problem is that if you use something like the below in the callback, it results in rather ugly console log - example below. Could someone suggest a clean cut solution ? I know that ideally adobe would need to fix this issue, but I don't want to wait till it is done.

 

if (/^javascript:/.test(content.linkUrl)) {
  reject("Operation aborted");
}

// OR 

if (/^javascript:/.test(content.linkUrl)) {
  throw new Error("javascript: url");
}

Console error - using reject();

Franc_G_0-1728485788580.png

 

0 Replies