Is there a way to get a single result from a json query.

Say I get an input from json that's Domestic Dog:Canis lupus familiaris. Since it's going to be in a tag, I want both sides to be related. So, is there a way I can show the: Domestic Dog in on textarea and Canis lupus familiaris in another.

I need them to be in tags so if I remove the Domestic Dog it will remove Canis lupus familiaris in the other. Only one field is editable (so it needs to be one way).

I thought about splitting the result, but that would make it into two separate fields, which is not working (yes, I've tried it using $.split().

有帮助吗?

解决方案 2

I solved this by creating a second function within the jQuery code.

Thanks anyway.

其他提示

Have you tried using JSON.parse to convert your JSON string into a JavaScript object? Then you can use it as you wish.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top