【发布时间】:2016-05-19 00:03:19
【问题描述】:
这是我的 ajax 代码:
$('select[id=currency-data]').change(function () {
var currency_id = $(this).val();
$.ajax({
url: "{{Route('exchange-rate')}}",
type: 'POST',
data: {currency_id: currency_id },
success: function(data){
$('#ex-rate').val(data);
}
});
});
查看:
{!! Form::label('currency_id', 'Currency:', ['class' => 'control-label']) !!}
{!! Form::Select('currency_id', $currency_data, Input::old('currency_id'), ['id'=>'currency-data','class' => 'form-control','required']) !!}
{!! Form::label('exchange_rate', 'Exchange Rate:', ['class' => 'control-label']) !!}
{!! Form::input('number','exchange_rate', Input::old('exchange_rate'), ['id'=>'ex-rate','class' => 'form-control','readonly','required']) !!}
当我运行这个时,我得到错误:VerifyCsrfToken.php 中的TokenMismatchException ..
谁能给出解决方案???
【问题讨论】: