I am debugging this ajax for quite a time now. I have this on my jQUery file:
$(\"#typeForm\").ajaxForm({
success : function(html){
alert(html);
Some stuff to try:
ajaxForm supports dataType argument, if you expect a JSON coming from the server, use dataType: json like so
$("#typeForm").ajaxForm({
success : function(html){
// html here is already automatically a json object
alert(html.prompt);
},
dataType: 'json'
}).submit();
Could you post the full service.php? OR try the following:
exit(json_encode(array('file_name' => $data['upload_data']['file_name'], 'prompt' => $str)));
-- EDIT --
Not sure why json_encode returns such weird string :s, is the json_encode a standard php library or an external library? I'm asking this because some servers don't have json_encode in their php installation... I tested on my local and using php internal json_encode and it works fine:
Nachricht empfangen!
Nachricht empfangen!<\/span><\/div>"}