From 3edf86519c924c80ad0d000d7934cc5fdecd107e Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 18 Jan 2011 19:32:34 -0800 Subject: debugging --- newuser.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'newuser.html') diff --git a/newuser.html b/newuser.html index 000976b..e817be5 100644 --- a/newuser.html +++ b/newuser.html @@ -12,10 +12,14 @@ $.post( "https://secure.dev.piny.be/piny-validate", { t: "Username", v: obj.value }, function( data ){ var res = $.parseJSON( data ); - if ( res.ok ) { - $("#username-error").removeClass( "error" ).html( "" ); + if ( res ) { + if ( res.ok ) { + $("#username-error").removeClass( "error" ).html( "" ); + } else { + $("#username-error").addClass( "error" ).html( res.msg ); + }; } else { - $("#username-error").addClass( "error" ).html( res.msg ); + $("#username-error").addClass( "error" ).html( "somehow res is null!" ); }; } ); -- cgit v1.2.3