Script Help

  • Started
  • Last post
  • 1 Response
  • autonoma

    This should be totally simple, but I can't figure out why this is not working for me. I'm trying to use this script (which is being loaded with onLoad in the body tag) to open all outside links on my site in a new window:

    function targetLinks() {
    var url = "";
    for (var i=0; i 1){
    }
    else if (url.split('tp://').length > 1){
    document.links[i].target = "_blank";
    }
    else{
    }
    }
    }

  • frankbb0

    because either PV-AN has messed it up or it doesn't make any sense... you have a for loop that doesn't do anything.. you might as well as used an if loop for what you have written..

    unless you know something that i don't in this area...