0

Hi,
I have the below code and it works fine except the part where I need to access data.Picture. I know its a syntax error but I can't seem to understand what.

$.post("rpc.php",arr, function(data)
{
$('#dorants').append(data);
$('#dorants').append(data.Picture);

Like always appreciate the help :)

2
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by vishalkhialani
0

Try with this while appending the response data to the div,don't know whether that works..

$('#dorants').html(data);
0

HI,
I was hoping I could access the variable in data by something like data.Picture ?

$('#dorants').append(data.Picture);
0

Ok..I think you can do it in jQuery.Suppose want to access class test which is the response html.Put a div outside it on the page(rpc.php)like ..

<div><div class="test"/> </div>

With tha Ajax response data
ie,

$.post("rpc.php",arr, function(data)
{
//We won't get html from 'data' because it is variable, so
   var content = $(data).find('.test').html();
   $('#dorants').append(content);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.