Hirdetés
- Meggyi001: Kuponok....
- gban: Ingyen kellene, de tegnapra
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Rap, Hip-hop 90'
- Gurulunk, WAZE?!
- Brogyi: CTEK akkumulátor töltő és másolatai
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- Magga: PLEX: multimédia az egész lakásban
- 
			  LOGOUT JavaScript != Java (A JavaScript nem összekeverendő a Javával, két különböző programozási nyelvről van szó!) 
Új hozzászólás Aktív témák
- 
			
			  btz addikt Ezt próbálgattam már. Nálam nem működik (szokás szerint) Először így próbáltam: <script type="text/javascript" >
 // Create a fake textarea
 const textAreaEle = document.createElement('textarea');
 // Reset styles
 textAreaEle.style.border = '0';
 textAreaEle.style.padding = '0';
 textAreaEle.style.margin = '0';
 // Set the absolute position
 // User won't see the element
 textAreaEle.style.position = 'absolute';
 textAreaEle.style.left = '-9999px';
 textAreaEle.style.top = `0px`;
 // Set the value
 textAreaEle.value = text;
 // Append the textarea to body
 document.body.appendChild(textAreaEle);
 // Focus and select the text
 textAreaEle.focus();
 textAreaEle.select();
 // Execute the "copy" command
 try {
 document.execCommand('copy');
 } catch (err) {
 // Unable to copy
 } finally {
 // Remove the textarea
 document.body.removeChild(textAreaEle);
 }
 </script>Ekkor a textAreaEle.value = text; érték nem volt definiálva így készítettem neki egy változót. var text = "tesztszöveg"; <script type="text/javascript" >
 // Create a fake textarea
 const textAreaEle = document.createElement('textarea');
 // Reset styles
 textAreaEle.style.border = '0';
 textAreaEle.style.padding = '0';
 textAreaEle.style.margin = '0';
 // Set the absolute position
 // User won't see the element
 textAreaEle.style.position = 'absolute';
 textAreaEle.style.left = '-9999px';
 textAreaEle.style.top = `0px`;
 var text = "tesztszöveg";
 // Set the value
 textAreaEle.value = text;
 // Append the textarea to body
 document.body.appendChild(textAreaEle);
 // Focus and select the text
 textAreaEle.focus();
 textAreaEle.select();
 // Execute the "copy" command
 try {
 document.execCommand('copy');
 } catch (err) {
 // Unable to copy
 } finally {
 // Remove the textarea
 document.body.removeChild(textAreaEle);
 }
 </script>Hiba: Uncaught TypeError: Cannot read property 'appendChild' of null. 
 Beraktam bodyba a scriptet, utána semmit nem csinált, viszont a hiba megszűnt.
 Aztán a document.body részt cseréltem document.getElementById("mainContent").appendChild(textAreaEle);-re. Így már megjelenik a textarea, benne a tesztszöveg felirattal. (A kódból kitöröltem azt a részt ami elrejti a textarea-t).<html>
 <body>
 <div id="mainContent">
 MAIN CONTENT<br />
 </div>
 <script type="text/javascript" >
 // Create a fake textarea
 const textAreaEle = document.createElement('textarea');
 var text = "tesztszöveg";
 // Set the value
 textAreaEle.value = text;
 // Append the textarea to body
 document.getElementById("mainContent").appendChild(textAreaEle);
 // Focus and select the text
 textAreaEle.focus();
 textAreaEle.select();
 // Execute the "copy" command
 try {
 document.execCommand('copy');
 } catch (err) {
 // Unable to copy
 } finally {
 // Remove the textarea
 //document.body.removeChild(textAreaEle);
 }
 </script>
 </body>
 <html>Viszont nem másol semmit a vágólapra. 
Új hozzászólás Aktív témák
- Hirtelen rájött az AMD, hogy mégsem szűnt meg egy funkció az egyes Radeonokon
- Meggyi001: Kuponok....
- Apple asztali gépek
- Donald Trump, stábja és az 51-es körzet?
- Sweet.tv - internetes TV
- Szünetmentes tápegységek (UPS)
- Okosóra és okoskiegészítő topik
- Kormányok / autós szimulátorok topikja
- Azonnali alaplapos kérdések órája
- OFF TOPIC 44 - Te mondd, hogy offtopic, a te hangod mélyebb!
- További aktív témák...
- Lenovo T14 Core i5 10210U 16Gb Ram 256Gb NVMe FullHD IPS Boltól Garanciával Számlával
- Vadonatúj Blackshark 4 256GB full turbó mobilgamer csomag, kártyafüggetlen!
- Lenovo T14 G2 Core i5 1145G7 16Gb Ram Intel Iris Xe 256 NVMe Boltból Granciával Számlával
- Dell 7430 Core i5 1245U 10 mag 12 szál 16Gb Ram 4K Kijelző Boltból Garanciával Számlával
- Lenovo E14 G4 Core i5 1235U 10 mag 12 szál 40Gb Ram Gyári Garancia Boltból Számlával
- Lenovo ThinkPad P15 Gen 2 Mobile Workstation - i7-11850H 32GB 512GB Nvidia RTX A4000 8GB 1 év gar.
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- BESZÁMÍTÁS! MSI H310M i5 9500 16GB DDR4 120GB SSD 2TB HDD RTX 3050 8GB Zalman T4 Plus AeroCool 550W
- Tablet felvásárlás!! Apple iPad, iPad Mini, iPad Air, iPad Pro
- XBOX Series X 1TB // Számla+Garancia //
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő
 
						 
								 
							
