I have an Ajax form. Now I want to supply a solid fallback if the user has JavaScript deactivated.
So far it works also without JavaScript, but the user then simply sees the JSON string as a result printed on blank white without styling because of
echo json_encode( $arr );
How do I add styling to this? Do I have to echo
a whole HTML page? Is it possible to enable a redirect for JS disabled or something?
The whole PHP bit looks like this:
if ( !empty( $invalidFieldArray ) ) {
// validation errors
$arr = array( "status" => "error" , "data" => $invalidFieldArray );
echo json_encode( $arr );
} else {
// all ok
$arr = array( "status" => "success" );
echo json_encode( $arr );
}