# Generic JavaScript View mailto link

**URL:** <https://forum.knime.com/t/generic-javascript-view-mailto-link/91838>\
**Category:** KNIME Extensions\
**Tags:** scripting\
**Created:** [April 21, 2026, 2:01pm UTC](https://forum.knime.com/t/generic-javascript-view-mailto-link/91838 "2026-04-21T14:01:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkehrli](https://forum-cdn.knime.com/user_avatar/forum.knime.com/rkehrli/32/72707_2.png) [@rkehrli](https://forum.knime.com/u/rkehrli)\
**Post date:** [April 21, 2026, 2:01pm UTC](https://forum.knime.com/t/generic-javascript-view-mailto-link/91838/1 "2026-04-21T14:01:46Z")

</div>

Hello

I’m having an issue with the Generic JavaScript View ([Workflow Application Header](https://hub.knime.com/knime/spaces/Workflow%2520Application%2520Components/Views%2520and%2520Widgets/Workflow%2520Application%2520Header~ZvAwkyncAfh_r3Wh/current-state))

I’m trying to use a mailto-link, I’ve already “hacked” the script to omit the target parameter if it’s an email address but unfortunatly it converts the @ to the decimal @

Screenshot from browser:

![image](https://forum-cdn.knime.com/uploads/default/original/3X/1/f/1ffc1ab07e6135e286ac9dcb21a8ffe0175fe51d.png)

The link gets transferred via string flow variable.

The code in question:

```javascript
names = $${Sname_linkList}$$.split(/\r?\n/)
urls = $${Surls_linkList}$$.split(/\r?\n/)
var containerDiv = document.createElement(‘div’);
containerDiv.id = ‘link-list’;

names.forEach((name, index) => {
var linkItem = document.createElement(‘div’);
linkItem.style.display = ‘flex’;
linkItem.style.alignItems = ‘center’;
linkItem.style.marginBottom = ‘10px’;

var link = document.createElement('a');
link.href = urls[index];
if (urls.some(url => url.includes("mailto"))){
}
else {
	link.target = "_blank";
}

```

The flow variables, the @ in the link text works fine.

![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/a/ba14fd5d961c6bf4be78c68ef832e952af1f7d79.png)

Any help is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![NurSenaAlici](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/n/df788c/32.png) [@NurSenaAlici](https://forum.knime.com/u/NurSenaAlici)\
**Post date:** [April 21, 2026, 3:09pm UTC](https://forum.knime.com/t/generic-javascript-view-mailto-link/91838/2 "2026-04-21T15:09:37Z")

</div>

Hi @rkehrli

The problem with KNIME is that it changes characters like the @ symbol into HTML entities, which are things like @, when you put flow variables into the JavaScript view.

To fix this issue quickly you can change the @ symbol back to what it’s supposed to be after you read the variable. You can do this with the following JavaScript code:

```javascript
urls = $${Surls_linkList}$$.split(/\r?\n/).map(u => u.replace(/&#64;/g, '@'));

```

If you think you will have other special characters too then you can use the browser to change everything back, to normal.

You can use this JavaScript function to do that:

```javascript
function decodeHtml(html) {
    var txt = document.createElement("textarea");
    txt.innerHTML = html;
    return txt.value;
}

var urls = decodeHtml($${Surls_linkList}$$).split(/\r?\n/);

```

Also, your `mailto:` handling is correct skipping `target="_blank"` for email links is the right call, as it prevents a blank tab from opening alongside the email client.

Hope this helps,

Sena

---

<div class="post-metadata">

**Author:** ![rkehrli](https://forum-cdn.knime.com/user_avatar/forum.knime.com/rkehrli/32/72707_2.png) [@rkehrli](https://forum.knime.com/u/rkehrli)\
**Post date:** [April 21, 2026, 3:53pm UTC](https://forum.knime.com/t/generic-javascript-view-mailto-link/91838/3 "2026-04-21T15:53:05Z")

</div>

@NurSenaAlici

Thanks, that worked perfectly. I suspected that it get’s changed along the way.

I should’ve added that I’m on 5.2.4 on the remote AP, on my local 5.11. install it returned the @ just fine.

---

<div class="post-metadata">

**Author:** ![NurSenaAlici](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/n/df788c/32.png) [@NurSenaAlici](https://forum.knime.com/u/NurSenaAlici)\
**Post date:** [April 21, 2026, 4:05pm UTC](https://forum.knime.com/t/generic-javascript-view-mailto-link/91838/4 "2026-04-21T16:05:53Z")

</div>

That’s great! Happy to help 😄

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [April 28, 2026, 4:06pm UTC](https://forum.knime.com/t/generic-javascript-view-mailto-link/91838/5 "2026-04-28T16:06:41Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
