/    Sign up×
Community /Pin to ProfileBookmark

How to open a link in a new window as before?

I have link as <a href=”url”>Link text</a>. I am trying to open this link in a new window but not only that. When I go back to my page and click on the link again so I want to jump to the same page (if it’s still open) and refresh it.

So the first time I click on the link … a new window
the second time I click on the link … if the previous window is still open … jump there and refresh.

Do you have any idea how to address the same window if it is open?
Thanks for any humm…

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@OctoberWindMay 16.2012 — This is exactly what the target attribute is for!

By specifying a unique 'framename' (not to be confused with HTML frames/framesets) you can open/reopen a link (or a set of links) in a specific window/tab
Copy linkTweet thisAlerts:
@Major_PayneMay 17.2012 — The target="" attribute always is misused because browsers are still reacting to it incorrectly. Sites do not control how links are opened on a web page. The links are set by the users' browsers' settings for Tabs. Or, they can right click any link and select to open in a new window or tab from the popup Context Menu.

Avoid forcing to open in a new window: http://www.webnauts.net/new-window.html

Force links to open in new window: http://www.knowlegezone.com/pages/document.aspx?item=9

If you want a correct way, which is not aways reliable depending on JS being enabled in the browser, use:

Open new window:

[CODE]onclick="window.open (this.href, ''); return false"[/CODE]
×

Success!

Help @emaikia spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...