[jQuery] ajax request with span update
Hi,
i create a function to update a span-element in a cell with an image.
when i klick the image, it will be replaced and the image-tag should
be replaced with the response.
the response is ok, but it doesnt display like response.
my function:
$j.ajax({
url: "/include/getstatus.php",
type: 'POST',
data: "table=" + table + "&field=" + field + "&status=" + status +
"&id=" + id,
beforeSend: function(){
$j('#'+table+id).fadeOut(500);
},
success: function( neuerstatus ) {
window.setTimeout( function() {$j('#'+table+id).html( neuerstatus );},
500);
alert(neuerstatus);
},
complete: function(){
$j('#'+table+id+'').fadeIn(500);
}
});
"neuerstatus" is the response and in firefox with an alert it shows me
the correct syntax:
<img onclick="changestatus("articles", "active", 0, 4);" src="/images/
admin/deaktivieren.gif" alt="deaktivieren" />
but if i look the html-code it shows me follow:
<span id="articles4" style="">
<img 4);="" 1,="" ,="" active="" articles="" onclick="changestatus("
alt="aktivieren" src="/images/admin/aktivieren.gif"/>
</span>
the default on page-loading is this:
<span id="articles4">
<img onclick="changestatus('articles', 'active', 1, 4);"
alt="aktivieren" src="/images/admin/aktivieren.gif"/>
</span>
is there anybody who can help me?
and please, sry for my bad english!! i'm german