Hi i want to open all external links in a frame. I have the frame www.domain.com/frame?http://www,google.com which works all i need now is some javascript that can make only external links open in the frame. all the links are posted by users so this needs to be dynamic. Can any one help me Thnaks
thats quite easy to do <script> //by Godkillah var linky='http://www.domain.com/frame' a=document.getElementsBytagName("a") for(i=0;i<a.length;i++){ if(!a[i].href.match(location.hostname)){ a[i].href=linky+"?"+a[i].href }} </script> Code (markup): i think its quite selfexplaining hope it helps, -Godkillah