function load() { sheet = document.getElementById("styleSheet").href.replace(/^.*\//, ''); select = document.getElementById("styleSheetSelector").value = sheet; } function swapStyleSheet() { var sheet = document.getElementById("styleSheetSelector").value; document.getElementById("styleSheet").setAttribute("href", "/static/" + sheet); httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function() {console.log(httpRequest.responseText);}; httpRequest.open("GET", set_session_url + "?style_sheet=" + sheet, true); httpRequest.send(); }