views:

31

answers:

1

On some links on my HTML page I have a special CSS class, that when clicked, I make a ajax call to a click.aspx page and track the click.

<a href="..." class="click" id="blah-1">blah-1</a>


$(".click").bind("click", function() {

          $.get("/click.aspx?&source=" + $(this).attr("id"));

});

So what is happening is the value of source, after clicking a few links (that open in a new window) becomes:

source=blah1

then it becomes

source=blah1,blah2
A: 

Hey,

Maybe you need to change it to:

$(".click")each(function(i) {
     $(this).bind("click", function() {
          $.get("/click.aspx?&source=" + $(this).attr("id"));
     });
});

so that each is processed separately...

Brian
I tried that, I think the issue is that the page doesn't load for some of the clicks, since the clicks open in a new browser??
Blankman