Hello! How can I get certain values in a link? I have a url like this: slide.html? title = Name & volume = 12 however I just want to display the volume value on an h2.
My Code:
$(document).ready(function(){
var html = '';
var query = location.search.slice(1);
var partesDaQuery = query.split("&");
var json = {};
partesDaQuery.forEach(function(partes){
var chaveValor = partes.split('=');
var paramsKey = chaveValor[0];
var paramsValue = chaveValor[1];
json[paramsKey] = paramsValue;
html += '<h2></h2>';
console.log(paramsValue);
});
$("#lista").html(html);
});