显示json_encode结果以在html中输入标签 [英] display json_encode result to input tag in html

查看:221
本文介绍了显示json_encode结果以在html中输入标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有这个问题,我想在输入标签中显示json结果.我尝试了答案,但结果不正确.

So I have this problem where I want to display the json result in input tag. I tried this Answer but the result is incorrect.

这是json数据:

["FAAS FRONT & BACK","NOA & TAX BILL"]

这是结果:

您可以看到每个字符都在输入框中.我该如何解决?

As you can see each character is in input box. How can I solve this?

结果应该是这样的:

推荐答案

在JS上,尝试使用

data = JSON.parse(data);

因此您可以将其用作对象.

So you can use it as an object instead.

这篇关于显示json_encode结果以在html中输入标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆