Home  >  Article  >  Backend Development  >  js传值给html有关问题

js传值给html有关问题

WBOY
WBOYOriginal
2016-06-13 12:56:55706browse

js传值给html问题
现遇到一个问题,如下
js 通过ajax 获取到了一个二维数组,因为用到了 smarty,
js怎么将值传到html页面啊。
html接收到值后可以循环输出,谢谢


------解决方案--------------------
json_encode

完后

for(o in data)
alert(data[o]);

循环json 数组

再来个 for v in data[o]

有需要的话 多少级你就做多少次吧.

Statement:
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