MadCap Flare Tricks: How to Open External Links in a new Window by Default

I’d like to share with you a script I’ve found on the MadCap Forums that you can use to open external links (<a href>) by default in a new target frame.

To do so, you can add the script below to the body part of your page layout (.flmsp):

<script type="text/javascript">/*<![CDATA[*/
$("a[href^='https://']").attr('target="_blank"');/*]]>*/</script>

Note that I’ve slightly modified the original script suggested at https://forums.madcapsoftware.com to fit my needs (http to https and the inverted commas in the attribute).

You can also replace the attribute value (“_blank” in this case) by:

_parent

_self

_top

And apply any other attribute supported by <a>. For a complete list, see: w3schools.com/tags/tag_a.asp

 

 

Leave a comment

I’m Marina

I’m a Product Manager in B2B SaaS, focused on turning complexity into structure and measurable outcomes.
I translate diverse business and user needs into roadmaps and features that create real value.

I bring stakeholders together, align priorities, and make decisions with customer impact at the core. I believe strong product thinking begins with clearly identifying what truly matters to users. When the right issue is defined and addressed with a simple and focused solution, meaningful results follow.

Learn more…