Please visit the new Mint Forum.
I've heard about "undefined" results in my Referrers but I can't fix those. I'm getting "undefined" results in my Outclicks. It's coming from my site so I'm the problem. What type of links cause this?
Offline
quick fix for undefined caused by images.
'pepper/andrewsutherland/outclicks/script.php' at line 77.
replace
path += "?outclick="+esc(elem.href);
to
if(elem.nodeName == 'IMG') {
path += "?outclick="+esc(elem.parentNode.href);
} else {
path += "?outclick="+esc(elem.href);
}That should fix all.
IE and Firefox are now showing proper urls.
This is for Outclicks 1.14
-janisto
Offline
Are you guys referring to records with "undefined" as the title? With the above fix I still have completely empty, i.e. "", outclicks. Anyone else seeing this?
Offline
i applied the fix and i'm still getting undefined outclicks
(i have the latest outclicks - 1.14)
if there's another fix let me know
cheers
Offline
I had discovered the same issue; I applied the fix mentioned above and it solved the issue.
Offline
I just applied the patch and went to the page where i noticed the 'undefined' - clicked around, seems to be ok now.
Ill post if this changes
CL
Offline
the "undefined" outclicks are now the majority of my outclicks..
i don't know what's wrong..
i noticed it's happening on two pages:
on one of those i have two links relating to the same page like these:
<a href="/section/#subsection1">link</a>
and on the other one i have few links that open in new window, i'm using javascript there:
<a href="http://example.com" onclick="window.open(this.href); return false;"><link</a>
but there are links like these on other pages too, and there were no undefined...
i'm not sure what might be wrong. if anyone has an idea let me know please
waiting for 1.15
cheers
Offline
Hi,
can you post the urls for those pages.
-janisto
Offline
Hmm - I'm still getting an 'undefined' after applying the patch.
Only seems to come from one page - I'm going to investigate further and see which link is triggering this.
CL
Offline
janisto wrote:
Hi,
can you post the urls for those pages.
-janisto
yes i can:
http://www.argostranslations.com/employment/translator/
http://www.argostranslations.com/partners/
i also noticed an undefined here:
http://www.argostranslations.com/articles/links/
thanks
Offline
janisto wrote:
That should fix all.
IE and Firefox are now showing proper urls.
This is for Outclicks 1.14
-janisto
Thank you, that worked perfectly.
Offline
bzikofski wrote:
janisto wrote:
Hi,
can you post the urls for those pages.
-janistoyes i can:
http://www.argostranslations.com/employment/translator/
http://www.argostranslations.com/partners/
i also noticed an undefined here:
http://www.argostranslations.com/articles/links/
thanks
any ideas what could be wrong? are those pages okay?
i'm getting undefined all the time..
cheers
Offline
Hi,
I think window.open is the reason.
Try removing this kind of links:
<a href='http://www.lisa.org/' onclick='window.open(this.href); return false;'>LISA</a>
If you use window.open just to validate your site strict, try using something like this instead:
http://pure-essence.net/archives/2006/0 … lexternal/
or use just target="_blank".
-janisto
Offline
thanks janisto
yeah that might be the window.open although i receive normal outclicks here for the same links and they are "defined" - that is i can see what the outclick was..
yeah that was my purpose for validation.. well i might change it to target _blank
or... wait for outclicks update ;)
cheers
Offline
I just did a fresh install of Mint 1.29, outclicks, and much more pepper. Everything is working fine except one external link was showing up as undefined in outclicks.
I tried the fix that janisto suggested... although it didn't work because it is looking for the img tag. The link which was causing my undefined had a span tag in it.
<a href="http://worknet.wisconsin.gov/worknet/"><span class="caps">WORK</span>net</a>
So i just changed his fix to this
if(elem.nodeName == 'SPAN') {
path += "?outclick="+esc(elem.parentNode.href);
} else {
path += "?outclick="+esc(elem.href);
}and it works now.
The two links shown here are the same link. One before the fix and one after.
So obviously the code needs something to allow for tags that are within the <a> element.
Offline
Yea... I was having this undefined problem too...
Is there a way to write a regular expression that looks for anything like em, strong, b, i, span, img and does this, or even a way to always find the node that contains the href?
Offline
A better fix (for the people above) would be:
if(elem.parentNode && elem.parentNode.href) {
path += "?outclick="+esc(elem.parentNode.href);
} else {
path += "?outclick="+esc(elem.href);
}Offline