karthik80c
asked on
How do i create a element based on server response in Jquery
Hi Experts ,
I want to create a element based on json response from server . Here is my json look like
and i need each of the Photo1 ,2 ,3 to create a element like this
tried with for loop i got only one picture 0
Any Suggestions on this
I want to create a element based on json response from server . Here is my json look like
[
{
"agentname": "Test Hari",
"contact": "",
"office": "",
"mytours": "",
"profilepic": "http://www.freyvogelfuneralhome.com/sitebuildercontent/sitebuilderpictures/heartc
.jpg",
"Price": "",
"Map": "",
"Address": "test hari",
"Photo1": "upload/image1.JPG",
"Photo2": "upload/image1.JPG",
"Photo3": "upload/image1.JPG",
"Photo4": "upload/image1.JPG",
"Photo5": "upload/image1.JPG",
"Photo6": "upload/image1.JPG",
"Photo7": "upload/image1.JPG"
}
]
and i need each of the Photo1 ,2 ,3 to create a element like this
<li><a href="#" data-image="upload/image1.JPG" class="active">Guest Bedroom 1</a></li>
tried with for loop i got only one picture 0
for (var i = 0; i < propertyData.length; i++) {
var content = ' <li><a href="#" '+propertyData[i]['Photo'+i]+' class="active">Picture '+i+'</a></li>';
$('#k-photos-labels-wrapper').append(content);
Any Suggestions on this
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks Julian . Its Working
You are welcome.
Open in new window