• Resolved fokjulle

    (@fokjulle)


    I am aware that there is a little bit of documentation surrounding this, but not enough.

    1. The website http://w2.syronex.com/jmr/safemailto/ is an awesome email anti-spam concept. They offer a free javascript code, to be inserted into a page, allowing a ‘mailto’ on your website, while stopping spambots from picking it up.

    2. I’ve looked at WP’s support page, for inserting javascript: http://codex.wordpress.org/Using_Javascript#Javascript_in_Posts

    3. The problem is that the javascript does not work, once inserted into – in my case – my ‘contact me’ WordPress Page.

    4. I’ve spoken to the website’s support team, and their response is

    Here is what you need to put in your post:

    <script type=”text/javascript”
    src=”http://trashmedia.co.za/wp-content/themes/comicpress/spamblocker.js”></
    script>
    <script type=’text/javascript’><!–
    show();
    //–></script><noscript><a
    href=’http://w2.syronex.com/jmr/safemailto/#noscript’>Click here (guarded
    by anti-spam solution)</noscript>

    And this goes into spamblocker.js:

    function show(){
    var v2=”H8HCEH4Y4YGGT8SBHSUTPXA”;var
    v7=unescape(“%22%5D%3A%26%281t-F84/9%5D7+%29%7D6%3B%7E%22%20”);var
    v5=v2.length;var v1=””;for(var
    v4=0;v4<v5;v4++){v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4)
    );}document.write(‘<a href=”javascript:void(0)”
    onclick=”window.location=\’mail\u0074o\u003a’+v1+’?subject=Via%20the%20Trash
    %20Media%20website’+’\'”>’+’Click here<\/a>’);
    }

    ‘spamblocker.js’ is simply a text file that I created, and changing the extension to ‘.js’. I inserted the code he suggested above, and put it into the relevant directory.

    If you’re interested in seeing my domain, it is http://www.trashmedia.co.za.

    Can anybody help me with getting this to work?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter fokjulle

    (@fokjulle)

    I’ve tried many things, and still can’t get it to work.

    Why would you want to add that to a post?

    Wouldn’t it make more sense to just add it to your theme instead?

    Perhaps your theme’s header or footer php file?

    Thread Starter fokjulle

    (@fokjulle)

    Because it’s a ‘contact me’ Page. It will sit within the content of that page.

    And what would prevent you to make a special template for that Page with all that JS and after that create the contact Page using that template?

    Thread Starter fokjulle

    (@fokjulle)

    Let me explain in a nutshell.

    When you insert a mailto in your contact page, it might look like this: myname@domain.com.

    So, in the context of the contact page, it might look like this:

    Please contact me by emailing me at myname@domain.com.

    The problem is that spambots search for open-ended mailtos like that, and then start spamming your address. What that website does, is offer a free javascript code that removes the mailto, and replaces it with a ‘click here’ mailto. Once clicked, a popup appears with an image verification prompt, followed by opening your email client.

    It’s simply a way to encrypt your mailto address. Here’s an active example: http://www.fascistamerica.net/ (click his ’email’ link.

    Now, I’m waiting for someone’s help…

    When you insert a mailto in your contact page…

    That’s a very bad idea, sorry. Nobody does that.

    Use a secure contact form.
    http://www.dagondesign.com/articles/secure-form-mailer-plugin-for-wordpress/

    Thread Starter fokjulle

    (@fokjulle)

    Ah come on… Someone MUST be able to help me out…?

    You’ve had two answers so far, both from the same guy. You’ve discarded both?!?

    Perhaps you had a question about one of the approaches Moshu has given you?

    i dont have time to answer (im out my door to work), but all the poor guy wants to do is add a little js to a post that results in a mailto link. Rather than tell him reasons why he shouldnt do it …

    A page template (see Pages) takes what, 30 seconds? Add javascript, done.

    A secure mailer negates the entire need for the javascript. Click link, install plugin. done.

    Or heck, a quick search would turn up a pile of posts all saying, “Turn off the WYSIWYG editor if you just gotta add javascript to posts”. (Users -> Your Profile. Bottom-most option, uncheck)

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Adding javascript to a Page.’ is closed to new replies.