As someone who learnt to program in the mid seventies I was always taught that there are no good or bad solutions, only better solutions.
So my attention was drawn to two bookmarklets on this site that achieve the same objective, namely to emulate McAfee's Site Advisor.
I've used MSA on IE so am aware of what it is supposed to do.
As the code for the two solutions is considerably different, but achieves the same results (to me anyway), my question (to you experts out there) is which of the coding is the better and why.
I in no way want this to be a criticism of the two authors or their respective solutions (we all have our own signature when it comes to programming), it's simply an honest attempt at understanding a little bit about Javascript.
The two solutions are:
javascript:void(window.open('http://siteadvisor.com/sites/'+document.location.href.substring(7)));
javascript: var url=document.location.toString(); var withouthttp=url.substring(7); var subpages=withouthttp.indexOf("/"); var cleanurl=withouthttp.substring(0, subpages); window.open("http://siteadvisor.com/sites/" + cleanurl); document.location=url;
Look forward to your responses :-D


LinkBack URL
About LinkBacks




Reply With Quote
