/    Sign up×
Community /Pin to ProfileBookmark

blank target link insert

Hi, I have a popup window to insert a link in my editor. This works fine as is.

I need to do this so that the target is blank (target=_blank).

Note: the text is selected prior to clicking the Link button in the editor toolbar.

[CODE]
function insertHyperLink() {
var hyperLink = document.all.url.value;
window.opener.document.getElementById(‘wysiwyg’ + qsParm[‘wysiwyg’]).contentWindow.document.execCommand(“CreateLink”, false, hyperLink);
window.close();
}
[/CODE]

How do I do that in this code?

Thanks in advance.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@edatzauthorJul 24.2010 — I've tried adding an innerHTML bit, but that didn't work - probably way I've done it.
[CODE]
function insertHyperLink() {
var hyperLink = document.all.url.value;
window.opener.document.getElementById('wysiwyg' + qsParm['wysiwyg']).contentWindow.document.execCommand("CreateLink", false, hyperLink).innerHTML = tgraget=_blank;
window.close();
}
[/CODE]

Any ideas, anyone?
Copy linkTweet thisAlerts:
@rnd_meJul 24.2010 — you will probably have to build the html yourself, and use "InsertHTML" to inject it into the selection.
Copy linkTweet thisAlerts:
@edatzauthorJul 24.2010 — I wouldn't know how. Thanks for your time anyway.
×

Success!

Help @edatz 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 5.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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...