Esempio
Decodifica un URI dopo la codifica è:
var uri = "my test.asp?name=stale&car=saab";
var enc = encodeURI(uri);
var dec = decodeURI(enc);
var res = enc + "<br>" + dec;
Il risultato della res sarà:
my%20test.asp?name=st%C3%A5le&car=saab //
Encoded URI
my test.asp?name=stale&car=saab
// Decoded URI
Prova tu stesso " Definizione e utilizzo
La funzione decodeURI () viene utilizzato per decodificare un URI.
Suggerimento: Utilizzare il encodeURI () funzione per codificare un URI.
Supporto per il browser
Funzione | |||||
---|---|---|---|---|---|
decodeURI() | sì | sì | sì | sì | sì |
Sintassi
decodeURI( uri )
valori dei parametri
Parameter | Description |
---|---|
uri | Required. The URI to be decoded |
Dettagli tecnici
Valore di ritorno: | Una stringa, che rappresenta l'URI decodificato |
---|
