문제

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