在javascript函数中复制filenaam [英] copy filenaam in javascript function
问题描述
大家好,
我有一个相当复杂的问题。
我使用以下功能来显示超链接:
a ="<" +" a href =''" ;;
b3 ="<" +" a href =''http:// nww。" ;;
L ="< /" +''a>< br>'';
函数h(a ){document.writeln(a)}
函数HN(link,tekst){target = telt(); if
(wi == 1)target =" _top" ;; h(b3 + link +"''" + tag + target +"''" +" onclick =''n(\"" + target +" \" ,\"" + QUOT; HTTP://nww." +链路+ QUOT; \",\"" + tekst + QUOT; \") '' " + QUOT ;>" + tekst + L)}
现在我需要一个额外的选项来存储如下文件名:
function HN(link,tekst,文件名)
函数HN应该重新排列,当我点击这个超链接
时,文件名会被存储到cli pboard,所以我可以用
Ctrl-V释放它。
例如:
HN(''nix.nothing .int / WHERE / 2005'',''我的
超链接'',''NIX.NOTHING.TEXT.20050723。'')
最后一部分:NIX.NOTHING.TEXT.20050723。是需要将
复制到剪贴板的部分。
任何人都知道我应该如何更改功能HN才能完成这项工作?
或者不可能吗?
问候
Marco
荷兰
Hi All,
I have a rather complicated problem.
I use following function to display a hyperlink:
a="<"+"a href=''";
b3="<"+"a href=''http://nww.";
L="</"+''a><br>'';
function h(a){document.writeln(a)}
function HN(link,tekst){target=telt();if
(wi==1)target="_top";h(b3+link+"''"+tag+target+"''"+ "onclick=''n(\""+target+"\",\""+"http://nww."+link+"\",\""+tekst+"\")''"+">"+tekst+L)}
Now I need an additional option to store a filename like:
function HN(link,tekst, filename)
The function HN should be rearranged that when I click this hyperlink
the filename gets stored to the clipboard, so I can release it with
Ctrl-V.
For Example:
HN(''nix.nothing.int/WHERE/2005'',''My
Hyperlink'',''NIX.NOTHING.TEXT.20050723.'')
Where the last part: NIX.NOTHING.TEXT.20050723. is the part which needs
to be copied to the clipboard.
Anyone knows how I should change the function HN to get this done?
Or is it not possible?
Regards
Marco
The Netherlands
推荐答案
ma ** **********@zonnet.nl 写道:
函数HN应该重新排列,当我点击这个超链接
文件名被存储到剪贴板,所以我可以用
Ctrl-V释放它。
例如:
HN(''nix.nothing.int/WHERE/2005'''''Yy
超链接'',''NIX.NOTHING.TEXT.20050723。''
最后一部分:NIX.NOTHING.TEXT.20050723。是需要复制到剪贴板的部分。
任何人都知道我应该如何更改功能HN才能完成这项工作?
或者是不可能的?
The function HN should be rearranged that when I click this hyperlink
the filename gets stored to the clipboard, so I can release it with
Ctrl-V.
For Example:
HN(''nix.nothing.int/WHERE/2005'',''My
Hyperlink'',''NIX.NOTHING.TEXT.20050723.'')
Where the last part: NIX.NOTHING.TEXT.20050723. is the part which
needs to be copied to the clipboard.
Anyone knows how I should change the function HN to get this done?
Or is it not possible?
函数HN(link,tekst,clipdata){
// IE仅
if(window.clipboardData) {
window.clipboardData.setData(''text'',clipdata);
}
...
}
JW
function HN(link, tekst, clipdata) {
// IE only
if (window.clipboardData) {
window.clipboardData.setData(''text'', clipdata);
}
...
}
JW
Janwillem,
感谢您的帮助,我应该在哪里添加这段代码?
喜欢这个?
函数HN(link,tekst,clipdata){
// IE仅
if(window.clipboardData){
window.clipboardData.setData(''text'',clipdata);
{target = telt(); if
(wi == 1)target =" _top"; h(b3 + link +"''" + tag + target +"' '" +" onclick =''n(\"" + target +" \"
,\"" +&q UOT; HTTP://nww." +链路+ QUOT; \",\"" + tekst + QUOT; \") '' " + QUOT;>" + tekst + L)}
}
Marco
" Janwillem Borleffs" < jw@jwscripts.com> schreef in bericht
news:42 *********************** @ news.euronet.nl ...
Janwillem,
Thanks for the help but where exactly should I add this piece of code?
Like this?
function HN(link,tekst,clipdata){
// IE only
if (window.clipboardData) {
window.clipboardData.setData(''text'', clipdata);
{target=telt();if
(wi==1)target="_top";h(b3+link+"''"+tag+target+"''"+ "onclick=''n(\""+target+"\"
,\""+"http://nww."+link+"\",\""+tekst+"\")''"+">"+tekst+L)}
}
Marco
"Janwillem Borleffs" <jw@jwscripts.com> schreef in bericht
news:42***********************@news.euronet.nl...
ma ************ @ zonnet.nl 写道:
函数HN应该重新排列,当我点击这个超链接时,文件名会被存储到剪贴板,所以我可以用
Ctrl-V释放它。 br />
例如:
HN(''nix.nothing.int/WHERE/2005''''My
Hyperlink'',''NIX.NOTHING.TEXT.20050723 。'')
最后一部分:NIX.NOTHING.TEXT.20050723。是需要复制到剪贴板的部分。
任何人都知道我应该如何更改功能HN才能完成这项工作?
或者是不可能的?
The function HN should be rearranged that when I click this hyperlink
the filename gets stored to the clipboard, so I can release it with
Ctrl-V.
For Example:
HN(''nix.nothing.int/WHERE/2005'',''My
Hyperlink'',''NIX.NOTHING.TEXT.20050723.'')
Where the last part: NIX.NOTHING.TEXT.20050723. is the part which
needs to be copied to the clipboard.
Anyone knows how I should change the function HN to get this done?
Or is it not possible?
函数HN(link,tekst,clipdata){
// IE仅
if(window.clipboardData){
window.clipboardData.setData(' 'text'',clipdata);
}
...
}
JW
function HN(link, tekst, clipdata) {
// IE only
if (window.clipboardData) {
window.clipboardData.setData(''text'', clipdata);
}
...
}
JW
Marco Krechting写道:
Marco Krechting wrote:
Janwillem,
感谢您的帮助,但我应该在哪里添加这段代码?
喜欢这个功能HN(链接,tekst,clipdata){
// IE仅
if(window.clipboardData){
window.clipboardData.setData('' text'',clipdata);
{target = telt(); if
(wi == 1)target =" _top"; h(b3 + link +"''" + tag + target +"''" +" onclick =''n(\"" + target +" \"
,\"" +" http://nww." + link +" \",\"" + tekst +" \")''" +">" + tekst + L)}
}
Janwillem,
Thanks for the help but where exactly should I add this piece of code?
Like this?
function HN(link,tekst,clipdata){
// IE only
if (window.clipboardData) {
window.clipboardData.setData(''text'', clipdata);
{target=telt();if
(wi==1)target="_top";h(b3+link+"''"+tag+target+"''"+ "onclick=''n(\""+target+"\"
,\""+"http://nww."+link+"\",\""+tekst+"\")''"+">"+tekst+L)}
}
不,因为这会使该函数对IE等其他浏览器无效。
需要从其他浏览器中排除的唯一部分是
window.clipboardData位。拿出我之前给你看的代码并插入
下面的原始函数体:
函数HN(link,tekst,clipdata){
// IE仅
if(window.clipboardData){
window.clipboardData.setData(''text'',clipdata);
}
//原始功能体
target = telt();
/ /我假设wi是在某个地方定义的?
if(wi == 1){
target =" _top";
}
h(....);
}
JW
No, because this will render the function useless to other browsers then IE.
The only part that needs to be excluded from other browsers is the
window.clipboardData bit. Take the code I have shown you before and insert
the original function body below it:
function HN(link,tekst,clipdata){
// IE only
if (window.clipboardData) {
window.clipboardData.setData(''text'', clipdata);
}
// Original function body
target=telt();
// I assume wi is defined somewhere?
if (wi==1) {
target="_top";
}
h(....);
}
JW
这篇关于在javascript函数中复制filenaam的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!