These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:13 pm Advanced search

traversing a link via javascript

If you are stuck or have questions regarding HTML or other Web technologies, ask your questions here. No question too dumb!

traversing a link via javascript

Postby pedz » Wed Apr 07, 2010 12:15 am

With Firefox for example, I can configure it so that when I hit "Command" (I'm a Mac user) and poke the link, it opens the page in a new tab or if I hit Shift-Command, it opens it in a new tab and goes to that tab. This is configurable in the browser. Its not unique to FF.

When I traverse a link via javascript, at least in the different ways I've done it so far, I do not get this feature. I tried once and failed to try and create an event and feed it back and that either didn't work or became very browser specific -- I can't recall. Mentally, I simply have it tagged as a failed experiment.

It would be nice if a link could be "traversed" via javascript exactly as if the user poked it with the mouse and get, for example, a new tab or a new window, based upon how the user has his browser configured and what modifier keys he has down at the time of the event.

As I recall, when I was researching the topic, there was some security concerns but I never followed all the claims and counter-claims.

If I want to read about this, which spec(s) is it? html5 or something else?
pedz
<h6>
 
Posts: 6
Joined: Tue Mar 16, 2010 12:49 am

Re: traversing a link via javascript

Postby zcorpan » Thu Mar 31, 2011 7:30 pm

The only way to do it is to actually use a real link. Why would it be nice to do it with javascript? What's your use case?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: traversing a link via javascript

Postby pedz » Thu Mar 31, 2011 7:44 pm

I don't see how I could be more explicit with my use case. Do you not understand when it would ever be useful to traverse a link with Javascript? Is that your question?
pedz
<h6>
 
Posts: 6
Joined: Tue Mar 16, 2010 12:49 am

Re: traversing a link via javascript

Postby zcorpan » Thu Mar 31, 2011 7:55 pm

You only say that it would be nice, you don't say what problem you're actually trying to solve. Sure I can come up with use cases myself, but I was asking for yours. :)
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Help & Advice

Who is online

Users browsing this forum: No registered users and 1 guest