【发布时间】:2019-01-06 12:14:45
【问题描述】:
我不知道如何将新数据从控制器附加到 html 视图。
我的 ajax 帖子(有效):
$.ajax({
type: 'get',
dataType: "json",
url:getWizardSelectionUri,
data: ....
success:function(data){
$('#bikeliste').empty()
.....
这是我的静态请求的 html
@foreach(App\Bike::all() as $cList)
<li class="list-group-item">
<table border="0" width="100%">
<colgroup width="200" span="3"></colgroup>
<td>
<a href="{{$cList->link}}" target="_blank">
<img src="{{$cList->bildlink}}" height="150" width= "auto">
</a>
<br>
</td>
<td>
<h5>
<a href="{{$cList->link}}" target="_blank">
<strong>{{$cList->hersteller}} </strong>
{{$cList->modell}}
{{$cList->modelljahr}}
<br>
</a>
</h5>
</td>
<td>
@if ($cList->gewicht)
<strong>Gewicht: </strong> {{$cList->gewicht}}<br>
@endif
@if ($cList->laufraddurchmesser)
<strong>Radgröße: </strong>{{$cList->laufraddurchmesser}}<br>
@endif
</td>
</table>
<br>
</li>
@endforeach
是否可以在不重新加载页面的情况下更改数据?
【问题讨论】:
标签: javascript php ajax laravel