$return['error'] = false;
$return['msg'] = 'You have been logged in! You will be redirected to the UserCP in 3 seconds! If redirection fails <a href="usercp.php">click here</a>';
Is being returned but the <a href
is being displayed as text and not a link.
Relevent snippet of a开发者_开发技巧jax code:
$.ajax({
type : 'POST',
url : 'logina.php',
dataType : 'json',
data: {
type : $('#typeof').val(),
login : $('#login').val(),
pass : $('#pass').val(),
},
success : function(data){
$('#waiting').hide(500);
$('#empty').show(500);
$('#message').removeClass().addClass((data.error === true) ? 'error' : 'success')
.text(data.msg).show(500)
if (data.error === true){
$('#reg').show(500);ß
$('#empty').hide();
}
else {
setTimeout(function(){ document.location = 'http://blahblah.com/usercp.php';}, 3000 );
}
Use .html rather than .text:
$('#message').removeClass().addClass((data.error === true) ? 'error' : 'success') .html(data.msg).show(500)
精彩评论