Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Anyway of creating a new window function within a URL hyperlink?

Posted on 2009-03-29
4
Medium Priority
?
181 Views
Last Modified: 2012-05-06
Is it possible to open a new window via a url hyperlink w/o html code?

I would like this particular link to open in a new window w/o specifying _blank reference, since actual html code won't work.  I know you can hold the shift button down when you click a link to get a new window, but can you add something to the link itself?

Http:\\google.com
0
Comment
Question by:mystikal1000
  • 2
4 Comments
 
LVL 6

Expert Comment

by:ITHelper80
ID: 24013965
So you dont want any type of code? I know this can be done with javascript.
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 24013982
no code
0
 
LVL 6

Accepted Solution

by:
ITHelper80 earned 2000 total points
ID: 24014024
I dont think you can without some kind of client side script. IF they are clicking on a hyperlink why couldnt you use some type of code?
0
 
LVL 12

Expert Comment

by:alien109
ID: 24014228
Your options are specify a target (_blank) which is not XHTML compliant or to use javascript.

option 1:

<a href="somewhere.html" target="_blank">link</a>

option 2:

<script type="text/javascript">
function openLink(e)
{
    window.open(e.getAttribute("href"));
}
</script>

<a href="somewhere.html" onclick="openLink(this);return false">link</a>

<a href="somewhereElse.html" onclick="openLink(this);return false">link</a>
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question