Skip to content

Instantly share code, notes, and snippets.

@fadur
Created March 21, 2012 16:37
Show Gist options
  • Save fadur/2149380 to your computer and use it in GitHub Desktop.
Save fadur/2149380 to your computer and use it in GitHub Desktop.
atach event to list
log_click = function(parent) {
$.each($(parent).children(), function(index, val) {
$(val).click(function(e) {
e.preventDefault()
var href, metadata, t, _href;
metadata = {api: "search",args: ""};
href = $(this).find('a').attr('href');
t = setTimeout("window.location.href = \"" + href + "\";", 500);
_href = href.split("/");
console.log(href, metadata, t, _href); //payload
});
});
};
log_click('.product_items')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment