mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 01:01:18 +03:00
Remove existing error messages before adding the latest response
This commit is contained in:
parent
5f705e80f6
commit
e513a20d07
|
@ -99,6 +99,7 @@ jQuery( document ).ready( function( $ ) {
|
||||||
closeModal();
|
closeModal();
|
||||||
$( button ).after( $( '<p>' ).html( '<em>' + response.message + '<em>' ) );
|
$( button ).after( $( '<p>' ).html( '<em>' + response.message + '<em>' ) );
|
||||||
} else {
|
} else {
|
||||||
|
$( 'div.notice' ).remove();
|
||||||
const $message = $( '<div>' )
|
const $message = $( '<div>' )
|
||||||
.addClass( 'notice notice-alt' )
|
.addClass( 'notice notice-alt' )
|
||||||
.addClass( response.success ? 'notice-success' : 'notice-error' )
|
.addClass( response.success ? 'notice-success' : 'notice-error' )
|
||||||
|
|
Loading…
Reference in a new issue