How to implement link conversion? For example, the link format is & nbsp;/php/"**"/"##& quot; & nbsp; what I want to implement is, on the webpage, there are 1st input boxes in the three input boxes, user input, 2nd input boxes in the ** content, and 3rd input boxes in the # Content. the generated address is displayed: /php/"**"/"##& quot;, how to implement link conversion by adding one click copy?
For example:
Link format:
/Php/"**"/"#"
What I want to achieve is that there are three input boxes on the webpage.
1st input boxes, user input, ** Content
2nd input boxes, user input, # content
The new address is displayed in the 3rd input boxes:/php/"**"/"#", and a copy button is added.
Who can provide the following source code? thank you !!
I want to learn vc. I just want vc to define variables, but Web programming is useless ..
------ Solution --------------------
Script
Function gett3 ()
{
Var t1 = document. getElementById ('T1'). value;
Var t2 = document. getElementById ('T2'). value;
Var t3 = '/php/' + t1 + '/' + t2;
Document. getElementById ("t3"). value = t3;
}
Function DoCopy (obj)
{
// Alert (obj); return false;
If (copy2Clipboard (obj )! = False)
{
// Alert ("copied successfully! ");
}
}
Copy2Clipboard = function (txt)
{
If (window. clipboardData)
{
Window. clipboardData. clearData ();
Window. clipboardData. setData ("Text", txt );
}
Else if (navigator. userAgent. indexOf ("Opera ")! =-1)
{
Window. location = txt;
}
Else if (window. netscape)
{
Try
{
Netscape. security. PrivilegeManager. enablePrivilege ("UniversalXPConnect ");
}
Catch (e)
{
Alert ("your firefox security restrictions restrict you from performing clipboard operations. open 'About: config' and set signed. applets. codebase_principal_support 'is set to true and then try again. The relative path is the firefox root directory/greprefs/all. js ");
Return false;
}
Var clip = Components. classes ['@ mozilla.org/widget/clipboard=1'mirror.createinstance (Components. interfaces. nsIClipboard );
If (! Clip) return;
Var trans = Components. classes ['@ mozilla.org/widget/transferable00001').createinstance (Components. interfaces. nsITransferable );
If (! Trans) return;
Trans. addDataFlavor ('text/unicode ');
Var str = new Object ();
Var len = new Object ();
Var str = Components. classes ["@ mozilla.org/supports-string1_1"]. createInstance (Components. interfaces. nsISupportsString );
Var CopyCode = txt; str. data = CopyCode;
Trans. setTransferData ("text/unicode", str, CopyCode. length * 2 );
Var clipid = Components. interfaces. nsIClipboard;
If (! Clip) return false;
Clip. setData (trans, null, clipid. kGlobalClipboard );
}
}
Script
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service