August 13, 201214 yr It's Monday and Murphy's first law of web design* has me scratching my head with a problem on the wife's blog. *a client will always ask you to do something you have never done before Q: How the hell do you piggyback analytics onto inline ads injected by javascript like Infolinks? I know that's an ugly bit of jQuery below, but it works up to point and will detect events inside a set of hard coded tags on a page but it will not work with the dynamically inserted span tags of the inline adverts. Can't quite figure out if it's me getting the jQuery screwed up or I'm going about it wrong entirely. The latter being more likely with only three cups of coffee so far today. $("[id^=IL_AD]").click(function (event) { id=event.target.id; txt=document.getElementById(aid).innerHTML; loadXMLDoc(txt, id); loadXMLDoc() is an ajax routine that passes the word assigned the the advert up to the server where IP, UserAgent etc can be logged
Create an account or sign in to comment