What I have done so far is added a couple of simple lines in.
Old Code:
assigntarget:function(){
var rexcludedomains=new RegExp(this.excludedomains.join("|"), "i")
var all_links=document.getElementsByTagName("a")
if (this.mode=="auto" || (this.mode=="manual" && this.togglebox.checked)){
for (var i=0; i<=(all_links.length-1); i++){
if (all_links[i].hostname.search(rexcludedomains)==-1 && all_links[i].href.indexOf("http:")!=-1)
all_links[i].target=ddwindowlinks.linktarget
New Code:
assigntarget:function(){
var rexcludedomains=new RegExp(this.excludedomains.join("|"), "i")
var all_links=document.getElementsByTagName("a")
if (this.mode=="auto" || (this.mode=="manual" && this.togglebox.checked)){
for (var i=0; i<=(all_links.length-1); i++){
if (all_links[i].hostname.search(rexcludedomains)==-1 && all_links[i].href.indexOf("http:")!=-1)
all_links[i].target=ddwindowlinks.linktarget
var origionalhref = all_links[i].href;
all_links[i].href='http://www.economizerz.com/externallinks/?url='.origionalhref
So by that I have told it to change the href on the link to
http://www.economizerz.com/externallinks/?url=
but the problem im having is adding the origional href onto the end. I thought that by setting a variable (origionalhref) to the value of the origional link's href it might work but it comes up with undefined so im guessing this syntax is wrong:
var origionalhref = all_links.href;
Any ideas how to fix it? Im basically storing the origional value of the link's href in a variable before changing it, and calling it later in the script when i want to change that link's href.