3 Replies Latest reply on Mar 2, 2018 7:53 AM by Donna Skoog

    Javascript in HTML Widget Prevents Hyperlinks from Opening in Browser

    nick.evans

      Hi All,

      I'm working on some redesign work for our site which utilizes some JS.

      I'm finding that if you put JS in an HTML widget, it makes your hyperlink (href) open within the widget itself, rather than the browser.

       

      Sample Code:

      <a id="msg" href="https://testcommunity.ivanti.com/docs/DOC-26891">place_holder</a>

      <script>

        document.getElementById("msg").innerHTML = Date();

      </script>

      You won't be able to hit our test site, but you can revise the url to one of your own communities docs if you wanted to test.

       

      If I put this in an HTML widget, it creates a hyperlink which is expected, but if you click it, rather than loading the href url in the browser, it loads it within the HTML widget.

      Video of behavior:

       

      I need to keep the JS that I’ll be using, so I’m trying to figure out:

      1. Can I over-ride some setting to let it open in the actual window/browser
      2. Can I bypass the limitation utilizing JS itself?

      I could workaround the limitation by setting my target=”_blank” and got to a new tab… but I don’t like that solution – so I'm calling that Plan B for now.