Вопрос

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