# Issue with script/mailto link

**URL:** https://discourse.roots.io/t/issue-with-script-mailto-link/1102
**Category:** uncategorized
**Created:** 2014-01-21T15:26:37Z
**Posts:** 8

## Post 1 by @gfaw20071 — 2014-01-21T15:26:38Z

I’m using a little script/css solution to prevent spam and collection of email-addresses.

I am using the identical script on several websites.

Now, the funny thing is, that it works on one website (basically clicking the email-address will open a window in your favourite email application), while the others fail.

I noticed that the website where it works is running on roots 6.5.0 while the others are 6.5.1

website w. working script: [http://360westx.com/contact/](http://360westx.com/contact/)  
website w. failing script: [http://simon-communications.com/](http://simon-communications.com/)

As for the latter, I only added this one script to the `_main.js`, so I suppose it can’t be a conflict.

Any ideas?

---

## Post 2 by @swalkinshaw — 2014-01-21T16:53:42Z

You should always be checking your dev tools console:

`Uncaught ReferenceError: mailto is not defined`

`mailto` isn’t even found in your `scripts.min.js` so that’s the problem. Not sure what exactly your workflow is. Are you using Grunt?

---

## Post 3 by @gfaw20071 — 2014-01-24T11:12:19Z

I’m using grunt on Windows with XAMPP for local development, as I use shared hosting which prevents me from shell access.

Anyway, this is the script that I use (in `_main.js`):  
`/*! Mask Email Address */ function mailto(host,name,tld) { window.location = 'mailto:'+name+'@'+host+'.'+tld; }`

And this is the corresponding LESS/CSS Code:  
`/* Mask Email Address */ .e-addy { text-decoration: none !important; } .e-addy:hover { color: #333 !important; text-decoration: underline !important; } .e-addy .at, .e-addy .dot { display: none; text-decoration: none !important; } .e-addy .domain:before { content: "@"; } .e-addy .domain:after { content: "."; }`

As I said, it works on Roots 6.5.0 not on 6.5.1

---

## Post 4 by @Foxaii — 2014-01-24T13:02:45Z

You need to run `grunt` after making changes to `_main.js`.

---

## Post 5 by @gfaw20071 — 2014-01-24T15:14:34Z

I know that I have to run `grunt` and that’s what I did. I’ve build several sites based on roots already. One of them, [http://simon-communications.com](http://simon-communications.com) is very basic, there is just the above mentioned script added to `_main.js`, I double-checked with `scripts.min.js`, also contained in here. the grunt-job runs without failure, so that can’t be causing it.

---

## Post 6 by @Foxaii — 2014-01-24T15:25:51Z

Then you need to upload the updated script to your server. The current version does not contain your `mailto` function.

---

## Post 7 by @gfaw20071 — 2014-01-24T19:49:45Z

That’s what I did. I added a mailto function, ran grunt succesfully and uploaded to the server.

---

## Post 8 by @Foxaii — 2014-01-24T20:24:48Z

All I can tell you is the script on your live server does not contain the mailto function; and that the function itself compiles fine locally (on Roots 6.5.1).

You’ll have to debug your workflow to find out what the problem is.
