umh, no, nn ho capito niente
nn sono esperto di javascript (a dire il vero nn c'è niente in cui sia esperto nel campo della programmazione) cmq,
ho provato a inserire la funzione da te segnalata all'interno del mio script e richiamarla, ma senza risultato
ecco il codice che ho provato ..
un esempio funzionante per usare questa funzione ?codice:<script language="Javascript"> <!-- /* Select and Copy form element script- By Dynamicdrive.com For full source, Terms of service, and 100s DTHML scripts Visit http://www.dynamicdrive.com */ //specify whether contents should be auto copied to clipboard (memory) //Applies only to IE 4+ //0=no, 1=yes var copytoclip=1 function HighlightAll(theField) { var tempval=eval("document."+theField) tempval.focus() tempval.select() if (document.all&©toclip==1){ therange=tempval.createTextRange() therange=copy_clip(therange) //therange.execCommand("Copy") -- -riga tolta dal codice...ad intuito :D window.status="Contents highlighted and copied to clipboard!" setTimeout("window.status=''",1800) } } // Copyright (C) krikkit - krikkit@gmx.net // --> http://www.krikkit.net/ // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. function copy_clip(meintext) { if (window.clipboardData) { // the IE-manier window.clipboardData.setData("Text", meintext); // waarschijnlijk niet de beste manier om Moz/NS te detecteren; // het is mij echter onbekend vanaf welke versie dit precies werkt: } else if (window.netscape) { // dit is belangrijk maar staat nergens duidelijk vermeld: // you have to sign the code to enable this, or see notes below netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); // maak een interface naar het clipboard var clip = Components.classes['@mozilla.org/widget/clipboard;1'] .createInstance(Components.interfaces.nsIClipboard); if (!clip) return; // maak een transferable var trans = Components.classes['@mozilla.org/widget/transferable;1'] .createInstance(Components.interfaces.nsITransferable); if (!trans) return; // specificeer wat voor soort data we op willen halen; text in dit geval trans.addDataFlavor('text/unicode'); // om de data uit de transferable te halen hebben we 2 nieuwe objecten // nodig om het in op te slaan var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); var copytext=meintext; str.data=copytext; trans.setTransferData("text/unicode",str,copytext.length*2); var clipid=Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans,null,clipid.kGlobalClipboard); } alert("Following info was copied to your clipboard:\n\n" + meintext); return false; } //--> </script>
thx..
kicko

 
			
			

 
					
					
					
						 Rispondi quotando
  Rispondi quotando