Kuartz
Kuartz

Reputation: 302

Using JavaScript to prevent email address to be used by bots

Do you think that a bot will be able to send mails to the email address mentioned on the page in HTML?

Here is my code :

<h6 class="text-gray">
    <script type="text/javascript">
        var email = 'gmail.com';

        email = ('blabla.blibli' + '@' + email);

        document.write('<a href="mailto:' + email + '">' + email + '</a>');
    </script>
    <noscript>

        L'adresse mail est protégée par Javascript

    </noscript>
</h6>

Upvotes: 0

Views: 1112

Answers (1)

Jens
Jens

Reputation: 21510

This probably won't help at all. Most bots scrape pages that are fully rendered. Your JavaScript will add the email address to the page when it is rendered.

So the HTML that is seen by the browser (or in this case the bot) already contains the email address at the right place, unobfuscated. It will be easy to read.

They do not have to "parse" your JavaScript script block to get to the information.

Upvotes: 2

Related Questions