Created
March 21, 2012 16:37
-
-
Save fadur/2149380 to your computer and use it in GitHub Desktop.
atach event to list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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