我使用.get()獲取視圖,我必須連接路徑中的兩個變量,但是當我這樣做的路徑留有很多空間。變量值從兩次下拉得到很好的收到。字符串與連接時的空格
的問題是:
function getTableData(){
$("#getTable").click(function(e){
table = $('#tabax').val();
type = $('#type').val();
alert(table);
alert(type);
alert("upload-file/tb/"+table+"/"+type);
$.get("upload-file/tb/"+table+"/"+type, function(response){
$('.table-data').html(response);
});
e.preventDefault();
});}
我的html:
<div class="form-group">
{!! Form::label('tabax', 'Table:') !!}
{!! Form::select('tabax', $tabax, null, ['id'=> 'tabax', 'class' => 'form-control tabax']) !!}
</div>
<div class="form-group">
{!! Form::label('type', 'Type:') !!}
{!! Form::select('type', $type, null, ['id'=> 'type', 'class' => 'form-control']) !!}
</div>
和路徑是:
http://localhost:8000/app/upload-file/tb/FT%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20/1
我不知道爲什麼會發生,我做這很多,這是我第一次遇到這個問題。
不知道你是什麼發佈(這是從OBV HTML拍攝),我們不能幫你。 –