kartik-v / yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0
http://demos.krajee.com/markdown
Other
89 stars 41 forks source link

400 Bad Request #27

Closed kangqf closed 10 years ago

kangqf commented 10 years ago

when i press the preview button ,it comes loading preview the error show 400 Bad Request send @ jquery.js:8623 jQuery.extend.ajax @ jquery.js:8152 togglePreview @ kv-markdown.js:86 (anonymous function) @ kv-markdown.js:357 jQuery.event.dispatch @ jquery.js:4409 elemData.handle @ jquery.js:4095

kangqf commented 10 years ago

may be it is caused by the crsf?

kangqf commented 10 years ago

oh yes when i add _csrf to the data which send to the preview action i get the correct result .

kartik-v commented 10 years ago

You can also read this wiki/webtip.

akorinek commented 9 years ago

How do I add the _csrf? I couldn't find this in the documentation and get the same error. Webtip doesn't help, the Html::csrfMetaTags() are in the view, but it still doesn't work. Usually I add a hidden _csrf field to the form I'm submitting via ajax, but in this case there is no form.