What’s wrong with my script.
it doesn’t create an html element on ajax success?
Here’s the script :
$('.ajaxForm').ajaxForm({
dataType : "json",
success : function(data){
if(data.msg=='ok'){
setTimeout("fnChangePage('/login')",5000);
}else{
$(".dialog p").html(data.msg);
$(".dialog").dialog({
title : "Error!"
});
}
}
});
my json’s output is like this :
{"msg":"<ul><li>Repeat Password!<\/li><li>Employee not found!<\/li><\/ul>"}

If the following line is the one that you want to create an html element:
Then you need
data.msgto contain that element including the html tags. So you’ll need to change your server-side code to output<and>instead of<and>. That is, your JSON output should be:If you can’t make the change server-side for some reason you could replace it in JS before using it: