Html(embed) code opening in new window/tab

By Helmut_pdorfHelmut_pdorf


With "html" command ( embed a foreign code) on a page you can insert near all scripts from external suppliers in your wiki-page ( see also snippet Use any html code on a page ).

The problem: sometimes you need the embbeded script called in your page that it is "opening in a new tab/window "

Thanks to Timothy FosterTimothy Foster !
There is an information from him on the community forum Thread Html & New Windows which is very clever solving this problem.
I have copied his post here for better understanding:


Currently your iframe looks like this:

<script src="" type="text/javascript">


Change it to this:

<base target="_blank" />
<script src="" type="text/javascript"></script>

Source info:
Test Page:

the little line @base target="_blank" /@ makes the trick…!

In action

Test Page:

Thanks Timothy!

Thanks to tsangk for this great snippet: conditional-blocks

text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]

Other snippets posted by Helmut_pdorf

Sorted-ListPages-List - 06 Jun 2021 03:46
Todo List with Data Forms - 30 Apr 2015 14:59
Facebook Button - 27 Dec 2013 15:03
Advanced Search - 25 Feb 2012 12:29
Top Nav Menu with ListPages - 16 Feb 2012 01:48
Schedules - 16 Feb 2012 01:40
Use any html code on a page - 16 Feb 2012 01:34
Find untagged pages - 15 Feb 2012 00:52

Rate this solution

If you think this solution is useful — rate it up!

rating: +2+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License