AmitKumar AmitKumar - 1 year ago 81
Ajax Question

This json object and how to make list element in page the below is code for Product.php


This my json object i will print on my product page but how can acheieve the list element in that looks like this

<li title="<?php echo $row['name'] ?>">
<a href="<?php echo $row['original']?>" rel="prettyPhoto[gallery1]">
<img src="<?php echo $row['thumb']?>" alt="Code ID" title="fash"/>

This php code but want print json data in
element Please i trying my best but doesn't get actual expected output

This search result of ajax call in json format which can display on product page in above code but how can achieve this code ?

Sorry for wrong question.

$("#gridArea ul li").hide();

var txt = $(this).val();
if(txt != '')
var=<li title="">
<a href="data.original" rel="prettyPhoto[gallery1]">
<img src="data.thumb" alt="Code ID" title="fash"/>


$("#gridArea ul li").show();

Answer Source

Do the following in your ajax success function

 var result='<li title="''"><a href="'+data.original+'"  rel="prettyPhoto[gallery1]"><img src="'+data.thumb+'" alt="Code ID" title="fash"/></a>';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download