Ajax.Updater is designed to take whatever the output of the ajax call is and dump it into the element with the id 'layer_save' (the first parameter). I would use the Ajax.Request()
method in this instance, and make sure your backend script sets the header Content-type: application/json
new Ajax.Request(reloadurl, {
method: 'post',
evalScripts: 'true',
parameters: "searchname="+searchname,
onLoading: function(){ $('loadingmask').show();},
onSuccess: function(transport) {
$('loadingmask').hide();
//if you set the json header this is auto-evaluated to json
var json = transport.responseJSON;
if(json.success == "true")
{
$('layer_save').update(json.html);
$('viewsearch').simulate('click');
}
else
{
// Failed to update
alert("Not a success, no update made");
}
}
});