But i get respnce in json, i.e alert(html)
<script>
function addcartAction(id){
var dataString='id='+id;
$.ajax({
type: "POST",
url:"<?php echo Yii::app()->request->baseUrl; ?>/testurl",
data: dataString,
success: function(html)
{
alert(html);
$("#cart-item").html(html);
}
});
}
</script>
{
"1": {
"ItemName": "Product1",
"id": "1",
"item_Image": "http://testurl.com/gallerythumb/test.JPG",
"price": "4.99",
"quantity": 1
},
"2": {
"ItemName": "Product2",
"id": "2",
"item_Image": "http://testurl.com/gallerythumb/test1.jpg",
"price": "7.99",
"quantity": 12
}
}
I have tried alot of different syntax but can't seem to figure this out. Can any one point me in the right direction?, so can i solve this one.