}\r
return cookieValue;\r
}\r
- if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {\r
- // Only send the token to relative URLs i.e. locally.\r
- xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));\r
- }\r
+ try {\r
+ if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {\r
+ // Only send the token to relative URLs i.e. locally.\r
+ xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));\r
+ }\r
+ } catch (e) {}\r
});\r
\r
var response_commands = {\r
}\r
\r
start_command();\r
- $.post($form.attr('action'), $form.serialize(), function(data) {\r
+ $.post($form.attr('action'), post_data, function(data) {\r
process_ajax_response(data, evt, function(error) {\r
if (!error) {\r
cleanup_form();\r