take data from the url using Avascript/jquery

Asked

Viewed 126 times

-1

I have a URL with the data encoded using encodeURIComponent. Then I decode it using decodeURIComponent and it looks like this:

http://localhost:8081/edit.html [{ "name": "Darth Vader", "ladoForca": "Negro", "species": "Human", "planet": { "name": "Tatooine", "regiao": "Sea of Dune and Judland Wastes" } }]

how do I access the values?

1 answer

0

Look I have a code a part of it is this, I use the Slice to remove

var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                        var hashes = retorno.split('&');
                                if(hashes.length > 2){
                                    for(var i = 0;i < hashes.length; i++){

                                    var titulo = decodeURI(getUrlTitulo(retorno)[i]);

                                    for(z=0;z < titulo.length;z++){
                                        titulo = titulo.replace("_"," ");
                                    }

ps: this is a part, the part that picks up the url, if you want it whole I can send you

  • but how come your url? in mine has not &

  • sorry for the delay, I will send as my url, the parameter & just change , but ire send how the url arrives .. I just checked , it is currently returning as a variable even, but the url would be concatenated like this .... id_sedex = "1"&cod_sedex = "123456789"&desc_sedex = "Test of select java"&destino_sedex = "Street do not do a minimum "&localatual_sedex = "Where Judas lost the boots"

  • http://localhost/app2/www/? src=123456789&select=1 another way is like this ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.