View Single Post
Old 02-03-2013, 04:36 PM   PM User | #41
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by VIPStephan View Post
I can tell you why: Because they are sick of Google, Facebook, and what not spying on their browsing behavior (by using cookies, for example) and showing them allegedly “relevant” information.
I don't use Facebook, but cookies can be blocked without disabling Javascript.

I'll stick with my opinion that the tiny number of people who see fit to disable Javascript should accept the consequences of their deliberate decision. And why should I put in a lot of effort to meet the needs of 2% of users? Does not the Pareto principle apply here? I would rather put in that effort for the 98%. None of the websites I have ever created could be said to be "script ridden websites that are slow and bulky to use." I don't like pointless decorative features either, but if they are implemented they put off 98% of users with Javascript enabled and not the 2% without.



Here's an example of a Javascript technique I often use to protect an email address:-

Code:
<script type = "text/javascript">

var goodurl = "";
// obfuscate the url
var urlrev = "ku.oc.xxx"
urlrev = urlrev += ".etisym@ofni"
goodurl = urlrev.split("").reverse().join("");
goodurl = goodurl + "?subject=Enquiry re this website";
document.write('<a href=\"mailto:' + goodurl +'">');
document.write('Contact us by email' + '<\/a>');

</script>

<noscript>
<p class = "protected">Email address protected by JavaScript.<br>
Please enable JavaScript in your browser to contact us.
</p>
</noscript>

If the user is unwilling to do that, then he is not worth bothering with. The idea that every potential customer is worth having is wrong. I prefer to keep awkward so-and-sos away. By all means let them go to a competitor (if such exists).

And with respect, my personal opinion is just as good as yours.

Before felgall chimes in, document.write() is still a perfectly satisfactory way to write the original content of your page.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 02-03-2013 at 04:52 PM..
Philip M is offline   Reply With Quote