Commit 081bdd92 by Piotr Mitros

GET -> POST

parent 844d506e
...@@ -19,7 +19,7 @@ $(function() { ...@@ -19,7 +19,7 @@ $(function() {
submit_data[value.name]=value.checked; submit_data[value.name]=value.checked;
}); });
$.getJSON('/create_account', postJSON('/create_account',
submit_data, submit_data,
function(json) { function(json) {
if(json.success) { if(json.success) {
...@@ -39,7 +39,7 @@ $(function() { ...@@ -39,7 +39,7 @@ $(function() {
submit_data[value.name]=value.value; submit_data[value.name]=value.value;
}); });
$.getJSON('/login', postJSON('/login',
submit_data, submit_data,
function(json) { function(json) {
if(json.success) { if(json.success) {
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
</script> </script>
<script type="text/javascript" src="/static/lib/mathjax/MathJax.js?config=TeX-AMS_HTML-full"></script> <script type="text/javascript" src="/static/lib/mathjax/MathJax.js?config=TeX-AMS_HTML-full"></script>
</head> </head>
<body> <body>
......
...@@ -9,7 +9,7 @@ function ${ id }_load() { ...@@ -9,7 +9,7 @@ function ${ id }_load() {
$.each($("[id^=input_${ id }_]"), function(index,value){ $.each($("[id^=input_${ id }_]"), function(index,value){
submit_data[value.id]=value.value; submit_data[value.id]=value.value;
}); });
$.getJSON('/modx/problem/${ id }/problem_check', postJSON('/modx/problem/${ id }/problem_check',
submit_data, submit_data,
function(json) { function(json) {
${ id }_load(); ${ id }_load();
...@@ -23,14 +23,14 @@ function ${ id }_load() { ...@@ -23,14 +23,14 @@ function ${ id }_load() {
submit_data[value.id]=value.value; submit_data[value.id]=value.value;
}); });
$.getJSON('/modx/problem/${ id }/problem_reset', {'id':'${ id }'}, function(json) { postJSON('/modx/problem/${ id }/problem_reset', {'id':'${ id }'}, function(json) {
${ id }_load(); ${ id }_load();
}); });
log_event('problem_reset', submit_data); log_event('problem_reset', submit_data);
}); });
$('#show_${ id }').click(function() { $('#show_${ id }').click(function() {
$.getJSON('/modx/problem/${ id }/problem_show', function(data) { postJSON('/modx/problem/${ id }/problem_show', function(data) {
for (var key in data) { for (var key in data) {
$("#answer_${ id }_"+key).text(data[key]); $("#answer_${ id }_"+key).text(data[key]);
} }
...@@ -42,7 +42,7 @@ function ${ id }_load() { ...@@ -42,7 +42,7 @@ function ${ id }_load() {
var submit_data={}; var submit_data={};
$.each($("[id^=input_${ id }_]"), function(index,value){ $.each($("[id^=input_${ id }_]"), function(index,value){
submit_data[value.id]=value.value;}); submit_data[value.id]=value.value;});
$.getJSON('/modx/problem/${ id }/problem_save', postJSON('/modx/problem/${ id }/problem_save',
submit_data, function(data){ submit_data, function(data){
if(data.success) { if(data.success) {
alert('Saved'); alert('Saved');
......
...@@ -17,7 +17,7 @@ $(function() { ...@@ -17,7 +17,7 @@ $(function() {
$("#location_sub").html('<input id="id_loc_text" type="text" name="loc_text" />'+ $("#location_sub").html('<input id="id_loc_text" type="text" name="loc_text" />'+
'<input type="button" id="change_loc_button" value="Change" />'); '<input type="button" id="change_loc_button" value="Change" />');
$("#change_loc_button").click(function() { $("#change_loc_button").click(function() {
$.getJSON('/change_setting', {'location':$("#id_loc_text").attr("value")}, function(json) { postJSON('/change_setting', {'location':$("#id_loc_text").attr("value")}, function(json) {
$("#location_sub").text(json.location); $("#location_sub").text(json.location);
loc=true; loc=true;
$("#description").html(""); $("#description").html("");
...@@ -35,7 +35,7 @@ $(function() { ...@@ -35,7 +35,7 @@ $(function() {
$("#language_sub").html('<input id="id_lang_text" type="text" name="lang_text" />'+ $("#language_sub").html('<input id="id_lang_text" type="text" name="lang_text" />'+
'<input type="button" id="change_lang_button" value="Change" />'); '<input type="button" id="change_lang_button" value="Change" />');
$("#change_lang_button").click(function() { $("#change_lang_button").click(function() {
$.getJSON('/change_setting', {'language':$("#id_lang_text").attr("value")}, function(json) { postJSON('/change_setting', {'language':$("#id_lang_text").attr("value")}, function(json) {
$("#language_sub").text(json.language); $("#language_sub").text(json.language);
lang=true; lang=true;
$("#description").html(""); $("#description").html("");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment