在AJAX中使用滑块
如何在单页应用程序(HTML AJAX回调)中使用此滑块函数 我的代码:在AJAX中使用滑块,ajax,Ajax,如何在单页应用程序(HTML AJAX回调)中使用此滑块函数 我的代码: <script type="text/template" id="bikes-template"> <div style="text-align:;"> <% collection.forEach(function(item){ %> <hr> <h3><%= item.brand %> <%= item.ty
<script type="text/template" id="bikes-template">
<div style="text-align:;">
<% collection.forEach(function(item){ %>
<hr>
<h3><%= item.brand %> <%= item.type %></h3>
<img src="<%= item.pic %> " alt="<%= item.name %>" style="width: 150px;">
<p>current miles: <%= item.currentMiles %></p>
//put slider here, but how?
<% }); %>
</div>
</script>
“alt=”“style=”宽度:150px;">
当前英里数:
//把滑块放在这里,但是怎么放呢?
滑块-
在我的html中使用上述模板脚本可以将html添加到我的html正文中。但是,我不知道如何添加包含函数的滑块
<script>
$(function() {
$( "#slider" ).slider();
});
</script>
<div id="slider"></div>
$(函数(){
$(“#滑块”).slider();
});
那么您想通过ajax调用插入整个过程吗?为什么需要ajax?