Specify Where to Open the Link - Current Page/ Frame or the Other Ones

Written by @m_k_amin 10 December 2012

There are links in all websites, but the problem is that when the visitor of our website clicks on the link, where the new page should be shown to us? In a new tab? In a new Windows? Or shown in an iframe? The following code shows all these modes to make the best choice for links in the websites.

Code Snippet:

                                                
                                                <!-- this script is provided by https://www.htmlfreecode.com coded by: Kerixa Inc. -->
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
Click here to open the link in the<br>
<a href="https://htmlfreecode.com/" target="_top"  >Main Page</a><br>
<a href="https://htmlfreecode.com/" target="_parent" >Parent Frame</a><br>
<a href="https://htmlfreecode.com/" target="_blank" >New Page</a><br>
<a href="https://htmlfreecode.com/" target="_self" >Current Frame</a><br>
<a href="https://htmlfreecode.com/" target="Frame1" >Frame 1</a><br>
<iframe id="Frame1" name="Frame1" style="height: 150px"></iframe><br><a target='_blank' href='https://www.htmlfreecode.com' style='font-size: 8pt; text-decoration: none'>Html Free Codes</a>                                                
                                            

Example:


About @m_k_amin

This user is pending a biography.

M

Comments


Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Ali7hry, alexnicola, Adam20, Prashanthcs11, Designer Diva
advertisement 2