我正在使用一個jQuery圖像滑塊,我想通了,如何將圖像從數據庫傳遞到我的圖像滑塊,但即時通訊的描述文本傳遞給每個圖像的問題,因爲圖像形成是在腳本中,我不知道如何將eval(「描述」)傳遞給腳本。下面是代碼:將描述文本從數據庫傳遞給jquery圖像滑塊
<script type="text/javascript">
if (!window.slider) var slider = {};
slider.data = [{ "id": "slide-img-1", "client": "nature beauty", "desc": "With up to 30 used caravans for you to choose from, you will soon be able to hit the open road...<br /> Come along and browse at your leisure or take a look at a selection of our current stock." }, { "id": "slide-img-2", "client": "nature beauty", "desc": "" }, { "id": "slide-img-3", "client": "nature beauty", "desc": "add your description here" }, { "id": "slide-img-4", "client": "nature beauty", "desc": "add your description here" }, { "id": "slide-img-5", "client": "nature beauty", "desc": "add your description here" }, { "id": "slide-img-6", "client": "nature beauty", "desc": "add your description here"}];
,所以我想通過類似 「說明」: '<%的eval( 「說明」)%>'
<div id="slide-runner">
<asp:Repeater ID="rptJquery" runat="server">
<ItemTemplate>
<a href="">
<img ID='<%#Eval("slideshowID") %>' src='<%#String.Format("/images/slideshow/{0}", Eval("imgURL"))%>' class="slide"/>
</a>
</ItemTemplate>
</asp:Repeater>
</div>
是<%#Eval(「說明」)%>不適用於您?我的意思是你試過了嗎? – 2011-04-12 21:10:29
沒有它的不工作,我想你不能使用它在javascripting – 2011-04-13 09:10:21