I am using this javascript code for redirecting and cloaking affiliate links. Just wondering if anyone had any suggestions or tips to make it better. It seems to do the job and set the affiliate tracking cookie. I know a few basics of javascript, but I am trying to learn. Can someone clarify what's happening in this script exactly? I understand the frame and onload parts, but the OnT and OnT2, what is that doing? Thank You! <html> <head> <title>My Big Title</title> <script language="JavaScript"> var Test = null; function SymError() { return true; } function OnT() { window.status = "Blah Blah Blah"; } function OnT2() { if (Test != null) { clearInterval(Test); } } window.onerror = SymError; Test = setInterval("OnT()", 100); </script> </head> <FRAMESET border=0 frameSpacing=0 rows=* frameBorder=0 marginbottom=0 marginright=0 margintop=0 marginleft=0> <FRAME border=0 src="http://www.myaffiliatelink.com?affiliate" frameBorder=no noResize OnLoad="OnT2()" id="frmMai" name="a"> <noframes> <body onload='document.location="http://www.myaffiliatelink.com?affiliate; OnT();"'> </body> </noframes> <script language="JavaScript" type="text/javascript"> OnT(); </script> </html> Code (markup):
.htaccess will redirect it, but it won't cloak the URL in the browser when they land on the affiliate site.
Uh, no it won't. It won't leave your URL in the browser when the new site is loaded on the page. It only redirects, it doesn't cloak.