echoing javascript when an ajax funtion is called
- by Roland
I'm doing a ajax call via the normal jquery ajax funtion
My ajax looks as follows
jQuery('#yt10').live('click',function(){jQuery.ajax({'data':{'set':$("#booking_set_id1").val(),'setStat':$("#booking_stockStatus").val(),'setNum':$("#booking_setNum").val()},'beforeSend':function(){
if($("#booking_set_id1").val() == "" || $("#booking_stockStatus").val() == "" || $("#booking_setNum").val() == ""){
$("#error").addClass("flash-error");
$("#error").html("Please fill in all relevant set details before adding a set");
return false;
}
},'dataType':'html','success':function(data,status){
$("#mainrow").show();
$("#error").removeClass("flash-error");
$("#error").html("");
$("#setTable tr:last").after(data);
$("#booking_set_id1").val("");
$("#booking_stockStatus").val("");
$("#booking_setNum").val("");
},'url':'/booking/newSet','cache':false});return false;});
Now the function newSet needs to echo javascript to the bowser but somehow jquery filters the javscript out. Is it possible to echo javascript via ajax