Home > Backend Development > PHP Tutorial > thinkphp中的js中怎么识别foreach volist中的变量

thinkphp中的js中怎么识别foreach volist中的变量

WBOY
Release: 2016-06-13 12:10:21
Original
1162 people have browsed it

thinkphp中的js中如何识别foreach volist中的变量?
thinkphp中的js中如何识别foreach 或volist中的变量?求帮忙
------解决思路----------------------
单独的js文件好像识别不了模板的标签的写法,除非你把js代码嵌套到模板。
------解决思路----------------------
取id的话,建议你用onclick,把你的id传到对应的js方法
------解决思路----------------------
php用json_encode包装好,传给js对象 var value = eval();

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template