Ich habe eine Schaltfläche in meiner Anwendung und wenn der Benutzer darauf klicken, möchte ich die Seite neu geladen werden. Dies ist meine Schaltfläche:Umleitung mit self.location.href funktioniert nicht
<button type="button" class="btn btn-success-outline add_sol">Ajouter</button>
Es ruft eine JavaScript-Funktion:
$(function() {
$(".add_sol").click(function(){
var e = document.getElementById("select_sols");
var sol = e.options[e.selectedIndex].value;
var string = window.location.pathname+"_ajouter_sol"+window.location.search+"&id_sol="+sol;
alert(string); //The alert displays the right adress
self.location.href(string);
});
});
ich eine Benachrichtigung mit dem string
Variable tat und es zeigt, was ich will. Aber ich weiß nicht, warum die self.location.href
nicht funktioniert.
window.location.href = xxxx aktualisieren? – Matthijs