Replace window.location with the full URL to prevent passing query parameters
* Example before: location + '/mark_as_solved' /request_for_comments/30885?locale=de/mark_as_solved Now: //localhost:3333/request_for_comments/30885/mark_as_solved Note: https or http will be added automatically by browsers
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
$(document).on('turbolinks:load', function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
if ($.isController('error_templates')) {
|
if ($.isController('error_templates')) {
|
||||||
$('#add-attribute').find('button').on('click', function () {
|
$('#add-attribute').find('button').on('click', function () {
|
||||||
$.ajax(location + '/attribute.json', {
|
$.ajax('//' + location.host + location.pathname + '/attribute.json', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
_method: 'PUT',
|
_method: 'PUT',
|
||||||
|
@ -17,7 +17,7 @@ $(document).on('turbolinks:load', function() {
|
|||||||
</a>';
|
</a>';
|
||||||
};
|
};
|
||||||
|
|
||||||
var jqxhr = $.ajax(window.location.href + '/tag_statistics', {
|
var jqxhr = $.ajax('//' + location.host + location.pathname + '/tag_statistics', {
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
|
@ -109,7 +109,7 @@ javascript:
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: location + '/mark_as_solved'
|
url: '//' + location.host + location.pathname + '/mark_as_solved'
|
||||||
}).done(function(response){
|
}).done(function(response){
|
||||||
if(response.solved){
|
if(response.solved){
|
||||||
solvedButton.removeClass('btn-primary');
|
solvedButton.removeClass('btn-primary');
|
||||||
@ -127,7 +127,7 @@ javascript:
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: location + '/set_thank_you_note',
|
url: '//' + location.host + location.pathname + '/set_thank_you_note',
|
||||||
data: {
|
data: {
|
||||||
note: value
|
note: value
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user