Hi there,
Just wondering if any Javascript gurus out there could possibly help me to figure something out?
I am using the great little blankwin.js script on a site and it works fine.
I have one slight need though. I would like to be able to not have it affect certain external links so I was thinking that perhaps I could place a certain class name on those links say something like css=“my-class disregard-blankwin” and then I can check for the disregard-blankwin part and if it exists on any links don’t apply the blankwin.js script
I did have a go by placing this :
/* SOF - My Code */
for(i=0;i<a.length;i++){
// Check for the right classname
if(a<i>.className != "disregard-blankwin"){
/* EOF - My Code */into the blankwin.js script just after the :
var a = document.getElementsByTagName("a");part and hoped that any links with that class name would get overlooked but it still just operated in the same way that it did originally. Just to mention that I did put in the two closing } brackets after the rest of the blankwin.js code so the javascript was all valid but it still seems to just get all the a links and apply the script regardless of the if className part that I have put in!
If anyone has any idea of what I am bufooning on about and can lend a hand then I would be most appreciative. My Javascript really isn’t that good and I find it quite difficult to get my head around at the moment what with everything else going on inside my noggin so thanks for any help on this. I did try though honest as can be seen from the code I tried to inject into the existing javascript 😉 😊 😉
Thanks in advance for any help on this one.
Best wishes,
Mark