You do not have commas in the right places in formData, I think you want this to be like this:
formData: [
{
name: '_http_accept',
value: 'application/javascript'
}, {
name: '<%= session_key_name %>',
value: encodeURIComponent('<%= u cookies[session_key_name] %>')
}, {
name: 'authenticity_token',
value: encodeURIComponent('<%= u form_authenticity_token %>')
}
]
Note that after parts name: ...there are commas, but not parts value: ....
, , encodeURIComponent() escaping/encoding <%= u ... URI. , , , , - , , ( , JavaScript ERB):
value: '<%= cookies[session_key_name].gsub(/'/, "\'") %>'
, POST, URL- .
, JavaScript, , '</td>', '<\/td>'.
jQuery-File, , , ( !).
source
share