//INIZIO PREPARAZIOEN QUERY // Raccatto i parametri dall'URL -- mi aspetto un parametro di nome 'link'! thisUrlParams = {}; window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { thisUrlParams[key] = value; }); console.log('URL get params: ', thisUrlParams.params); function prepareQueryURL(query){ sparqlEndpoint = 'http://dev.restore.ovi.cnr.it:8890/sparql/'; sparqlUrlParams = '?default-graph-uri=&query=' + encodeURIComponent(query) + '&output=json&callback=?'; return sparqlEndpoint + sparqlUrlParams; } function doJsonQuery(query) { queryURL = prepareQueryURL(query); return $.ajax({ url: queryURL, dataType: "json", type: 'GET' }); } // Funzioni per raccattare + stringhificare l'output queryStringOutput = ""; function stringifyResponse(val){ resultArray = val['results']['bindings']; out = ""; for(i = 0; i < resultArray.length; i++){ out = out + JSON.stringify(resultArray[i]) } queryStringOutput = (queryStringOutput + out).replace("}{",","); } //FINE PREPARAZIONE QUERY $(document).on("click", ".luogo", function (ev) { var link = this.id; window.open("Luogo.html?link="+this.id, "_self"); }); $(document).on("click", ".persona", function (ev) { var link = this.id; window.open("Persona.html?link="+this.id, "_self"); }); $(document).on("click", ".lettera", function (ev) { var link = this.id; window.open("lettera.html?link="+this.id, "_self"); }); $(document).on("click", ".object", function (ev) { var link = this.id; window.open("object.html?link="+this.id, "_self"); }); $(document).on("click", ".artwork", function (ev) { var link = this.id; window.open("OA.html?link="+this.id, "_self"); }); function schedaASPO(info){ window.open(info); } $(document).on("click", ".hyp", function (ev) { var baseurl = window.location.origin+window.location.pathname; let slash = baseurl.lastIndexOf("/"); var type = $(this).val() + '.html'; var link = this.id; var url = baseurl.substr(0, slash+1) + type + "?link="+link; var link = this.id; $("#myModal").empty(); $("#myModal").css("display", "block"); $('#myModal').append("