Frage

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().

War es hilfreich?

Lösung 2

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

Thanks anyway.

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top