Torna indietro   Hardware Upgrade Forum > Software > Programmazione

HP OmniBook 3 con Snapdragon X: autonomia da record nella fascia d段ngresso
HP OmniBook 3 con Snapdragon X: autonomia da record nella fascia d段ngresso
Lo Snapdragon X arriva nella fascia d段ngresso con HP OmniBook 3: oltre 17 ore di autonomia, una tastiera comoda e porte ben distribuite, ma anche 8 GB di RAM saldata, una GPU modesta e i compromessi di Windows su ARM. Vediamo a chi si rivolge questo notebook da 14 pollici e se il prezzo � giustificato
Nuova Dacia Spring, del modello precedente resta solo il nome: più grande, più efficiente e ora prodotta in Europa
Nuova Dacia Spring, del modello precedente resta solo il nome: più grande, più efficiente e ora prodotta in Europa
La seconda generazione della citycar elettrica di Dacia passa alla piattaforma RGEV small di Renault Group, cresce di 15 cm in lunghezza e 18 cm in larghezza, adotta un motore da 80 CV e una batteria LFP da 27,5 kWh per 250 km WLTP. Prezzi da 17.900 euro, produzione a Novo Mesto in Slovenia.
BOOX Picco: l'ebook reader minuscolo è una genialata, e si può attaccare allo smartphone
BOOX Picco: l'ebook reader minuscolo è una genialata, e si può attaccare allo smartphone
BOOX ha portato sul mercato Picco, un e-reader da 3,97 pollici che pesa 58 grammi e si aggancia al retro dello smartphone con un anello magnetico. Lo abbiamo usato con Pixel 11 Pro XL e iPhone 18 Pro per capire se un formato cos� ridotto regga la prova della lettura quotidiana
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 31-12-2005, 12:26   #1
frizzo28
Senior Member
 
Iscritto dal: Aug 2005
Citt�: Roma sud
Messaggi: 590
[javascript] Aggiungere dati in una textarea

Ciao a tutti sto creando un guestbook con javascript e php solo che ho il seguente problema: Vorrei inserire il codice dellle varie faccien nel punto dove sta il puntatore e non alla fine della textarea io ho usato na cosa del genere document.guest.testo.value=document.guest.testo.value+'' ad esempio per� cos� mi aggiunge alla fine della textarea come fare ad inserirlo nel punto dove c'� il cursore????? GRAzie a tutti
__________________
-Mac Book intel core duo 1,83GHz, 1,25 Gb RAM
-Amd athlon 64 dual core 4400+, 2 GB RAM, Asus a8n-sli Deluxe, totale 500 GB di HARD DISK(4 hdd)
frizzo28 � offline   Rispondi citando il messaggio o parte di esso
Old 31-12-2005, 12:48   #2
kk3z
Senior Member
 
L'Avatar di kk3z
 
Iscritto dal: Nov 2003
Messaggi: 980
Dallo javascript modificato dell'IPB forum:
(devi sostituire "Post" con il "name" della tua textarea: <textarea name="qualchenome" ecc></textarea>)
Codice:
//--------------------------------------------
// GENERAL INSERT FUNCTIONS
//--------------------------------------------
// sel: selection
// 		Gecko: Array(selected text, selection start, selection end)
//		IE: Array(selected text, TextRange object)
//		Other: false
// val: text to insert

function _insertAtSelection(sel, val)
{
	var obj_ta = (dom)? document.getElementsByName('Post')[0]: document.all.Post;
	obj_ta.focus();

	if(sel.length > 2){
		var txt  = obj_ta.value.substring(0, sel[1]);
		txt += val;
		txt += obj_ta.value.substring(sel[2], obj_ta.value.length);
		obj_ta.value = txt;

		if(obj_ta.setSelectionRange){
		    sel[2] = sel[1] + val.length;
		    if(insertMode == 1 || !sel[0].length)
				obj_ta.setSelectionRange(sel[2], sel[2]);
			else
				obj_ta.setSelectionRange(sel[1], sel[2]);
		}
	}
	else if(sel.length == 2){
		var len = sel[1].text.length;
		sel[1].text = val;

	    if(insertMode != 1 && len)
		    sel[1].moveStart('character', -val.length);
	    sel[1].select();
	}
	else {
		obj_ta.value = val;
	}

	obj_ta.focus();
}

// Returns a selection as described above
function _getTASelection()
{
	var sel;
	var obj_ta = (dom)? document.getElementsByName('Post')[0]: document.all.Post;

	obj_ta.focus();

	if(obj_ta.setSelectionRange){
	    var s = obj_ta.selectionStart;
	    var e = obj_ta.selectionEnd;
		sel = obj_ta.value.substring(s, e);
		// Cut off blank at end
		if(s < e && sel.charAt(sel.length - 1) == ' '){
			sel = sel.substring(0, sel.length - 1);
			e--;
		}

		return new Array(sel, s, e);
	}
	else if(!dom && !window.opera && !is_mac){
		sel = document.selection;
		var rng = sel.createRange();

		if((sel.type == "Text" || sel.type == "None") && rng != null){
			rng.collapse;
			// Cut off blank at end
			if(rng.text.length > 1 && rng.text.charAt(rng.text.length - 1) == ' ')
				rng.moveEnd('character', -1);
		    rng.select();

			return new Array(rng.text, rng);
		}
	}

	return new Array('');
}
Per trovare che browser si sta usando:
Codice:
var is_ie   = ((myAgent.indexOf("msie") != -1)  && (myAgent.indexOf("opera") == -1));
var is_nav  = ((myAgent.indexOf('mozilla')!=-1) && (myAgent.indexOf('spoofer')==-1)
                && (myAgent.indexOf('compatible') == -1) && (myAgent.indexOf('opera')==-1)
                && (myAgent.indexOf('webtv') ==-1)       && (myAgent.indexOf('hotjava')==-1));

var is_win  = ((myAgent.indexOf("win")!=-1) || (myAgent.indexOf("16bit")!=-1));
var is_mac  = (myAgent.indexOf("mac")!=-1);

var dom     = (document.getElementById && !document.all);
Per quello che so questo funziona con i browser basati su gecko e con IE, con gli altri non funziona.
kk3z � offline   Rispondi citando il messaggio o parte di esso
Old 31-12-2005, 13:08   #3
frizzo28
Senior Member
 
Iscritto dal: Aug 2005
Citt�: Roma sud
Messaggi: 590
sel, val a questi due valori cosa sono? uno suppongo il testo da aggiungere e l'altro? Grz
__________________
-Mac Book intel core duo 1,83GHz, 1,25 Gb RAM
-Amd athlon 64 dual core 4400+, 2 GB RAM, Asus a8n-sli Deluxe, totale 500 GB di HARD DISK(4 hdd)
frizzo28 � offline   Rispondi citando il messaggio o parte di esso
 Rispondi


HP OmniBook 3 con Snapdragon X: autonomia da record nella fascia d段ngresso HP OmniBook 3 con Snapdragon X: autonomia da rec...
Nuova Dacia Spring, del modello precedente resta solo il nome: più grande, più efficiente e ora prodotta in Europa Nuova Dacia Spring, del modello precedente resta...
BOOX Picco: l'ebook reader minuscolo è una genialata, e si può attaccare allo smartphone BOOX Picco: l'ebook reader minuscolo è un...
AMD EPYC Venice: dentro Zen 6, i SoC a 256 core e la sfida al costo della memoria AMD EPYC Venice: dentro Zen 6, i SoC a 256 core ...
HONOR Pad X9 Max recensione, schermo ultra large a meno di 400 euro HONOR Pad X9 Max recensione, schermo ultra large...
Supercomputer, la TOP500 di novembre non...
NVIDIA Blackwell nel mirino: la GPU Inte...
NVIDIA, il consiglio di amministrazione ...
NVIDIA Rubin HPC: oltre 50.000 CUDA core...
iPhone 18 non � arrivato a settembre e l...
SignDrop, lo zero-day che trasforma la s...
LibreOffice aggiorna la suite: meno cras...
ECOVACS X12 OmniCyclone Care Complete: 4...
Lenovo Legion prototipo con OLED a 360 H...
HUAWEI XMAGE Awards 2026: annunciati i v...
Il robot che fa il bucato in hotel lasci...
I pesi di DeepSeek e Kimi tradiscono GPU...
Pixel 11 Pro, il LED posteriore smette d...
Qwen4-Max non � open: Alibaba tiene chiu...
ChatGPT Wallet fa pagare gli agenti AI s...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB � On
Le Faccine sono On
Il codice [IMG] � On
Il codice HTML � Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 00:23.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v