Javascript: Window. Open(Window. clickTag) Opens Double Tabs in Firefox

I am using clickTags in my code for tracking. This is my setup.

<script type="text/javascript">
    var clickTag = "";
</script>

<a href="javascript:window.open(window.clickTag)">
---Content---
</a>

The issue is with Firefox opening double tabs when I click on the link. I only want it to open to the information that is associated with the link. My question, is there a workaround or is there a bug with Firefox?

1

2 Answers

For this i would create a function (see below)

<script type="text/javascript">
    function clickTag() {
    return ""
    }
</script>

<a href="#" onclick="window.open(clickTag()); return false;">Link</a>
1

javascript:window.open(window.clickTag) was what i got from coding from my website and then copying it after it finilized. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest