Home Backend Development PHP Tutorial 在js中调用Smarty的有关问题

在js中调用Smarty的有关问题

Jun 13, 2016 am 10:13 AM
list loop section smarty text

在js中调用Smarty的问题
在一个模板页(html)中的js里需要调用列表,对数组进行赋值,但下面的代码貌似不行,请教。

var imag=new Array();
var link=new Array();
var text=new Array();
{section name=list loop=$ppt setp=1 start=1}
imag[$smarty.section.loop.index]={$ppt[list].imgurl};
link[$smarty.section.loop.index]={$ppt[list].linkurl};
text[$smarty.section.loop.index]={$ppt[list].title};
{/section}
//可编辑内容结束
var swf_height=show_text==1?pic_height+20:pic_height;

=======================
需要对imag/link/text数组进行赋值,实现幻灯片效果,请教要怎么修改。谢谢。

------解决方案--------------------
http://my.oschina.net/u/200745/blog/35727

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to implement Redis List operation in php How to implement Redis List operation in php May 26, 2023 am 11:51 AM

List operation //Insert a value from the head of the list. $ret=$redis->lPush('city','guangzhou');//Insert a value from the end of the list. $ret=$redis->rPush('city','guangzhou');//Get the elements in the specified range of the list. 0 represents the first element of the list, -1 represents the last element, and -2 represents the penultimate element. $ret=$redis->l

How to convert JSONArray to List in Java How to convert JSONArray to List in Java May 04, 2023 pm 05:25 PM

1: JSONArray to ListJSONArray string to List//Initialize JSONArrayJSONArrayarray=newJSONArray();array.add(0,"a");array.add(1,"b");array.add(2,"c") ;Listlist=JSONObject.parseArray(array.toJSONString(),String.class);System.out.println(list.to

How to sort a list using List.Sort function in C# How to sort a list using List.Sort function in C# Nov 17, 2023 am 10:58 AM

How to sort a list using the List.Sort function in C# In the C# programming language, we often need to sort the list. The Sort function of the List class is a powerful tool designed for this purpose. This article will introduce how to use the List.Sort function in C# to sort a list, and provide specific code examples to help readers better understand and apply this function. The List.Sort function is a member function of the List class, used to sort elements in the list. This function receives

What are the common methods of List in Java basics What are the common methods of List in Java basics May 14, 2023 am 10:16 AM

1. Introduction to List interface List is an ordered collection and a repeatable collection. It inherits the Collection interface. Repeated elements can appear in the List collection, and the element at the specified position can be accessed through the index (subscript). 2. List common methods - voidadd (intindex, Obejctelement) method 1. The voidadd (intindex, Obejctelement) method inserts the element element at the specified position and moves the subsequent element back one element. 2.voidadd(intindex,Obejctelemen

How to convert array to List in Java How to convert array to List in Java Apr 19, 2023 am 09:13 AM

1. The most common way (not necessarily the best) is through Arrays.asList(strArray). After converting the array into List, you cannot add or delete the List, you can only check and modify it, otherwise an exception will be thrown. Key code: Listlist=Arrays.asList(strArray);privatevoidtestArrayCastToListError(){String[]strArray=newString[2];Listlist=Arrays.asList(strArray);//Insert a piece of data into the converted list list.add(" 1&quot

Why doesn't list.sort() return a sorted list in Python? Why doesn't list.sort() return a sorted list in Python? Sep 18, 2023 am 09:29 AM

Example In this example, we first look at the usage of list.sort() before continuing. Here, we have created a list and sorted it in ascending order using sort() method - #CreatingaListmyList=["Jacob","Harry","Mark","Anthony"]#DisplayingtheListprint("List=",myList)#SorttheListsinAscendingOrdermyList .sort(

How to leverage AI Copilot for collaboration in the Microsoft Loop collaboration platform? How to leverage AI Copilot for collaboration in the Microsoft Loop collaboration platform? Nov 18, 2023 pm 01:33 PM

Microsoft Loop, enhanced with its new feature Copilot, is a modern tool designed to improve the way teams collaborate. It consists of three main parts: components, pages, and workspaces. Components are things like lists or notes that stay updated no matter where you use them, whether in email, documents, or chat. This means you are always working with the latest information. Cycle pages are like digital whiteboards where you put all your components, tasks, and data together. These pages can grow as your project grows, making it easy to keep everything in one place. Workspaces in Loop are shared areas where your team can view and organize everything important to the project, helping everyone

How to download and use Microsoft Loop How to download and use Microsoft Loop May 08, 2023 pm 01:16 PM

Microsoft is ready to give users access to the first preview version of the Loop project. Now, let's learn where to get it, how to install it and how to get the most out of it. Want to learn how to use this software across Office apps and manage tasks? You've come to the right place. What is the Microsoft Cycle? What should we say? You can compare loops to project boards. Here you can see a list of all Loop components and Loop pages, and who is currently working on them. Think of it as a modern file explorer where everything is live and collaborative. The loop page is a separate canvas where people can share and collaborate on loop components. In addition, Loop components are constantly updated and edited, without

See all articles