JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container_12" id="action-error">
<span class="error">Error: There was an error deleting your album. Please try again.</span>
</div>
<div class="container_12" id="action-success">
<span class="success">Your album was deleted successfully.</span>
</div>
CSS
div#action-error
{
text-align: center;
border: 1px solid white;
display: none;
background-color: #a80077;
border-radius: 15px;
}
/* success div */
div#action-success
{
text-align: center;
border: 1px solid white;
display: none;
background-color: #5a8e4a;
border-radius: 15px;
}
JavaScript
$.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results==null){
return null;
}
else{
return results[1] || 0;
}
};
(function($){
//-----------
var error = $.urlParam('param1'); ;
if(error){
alert(error);
$('#action-error').show();
}
//------------------------------------------------------------------
var success = $.urlParam('param2'); ;
if(success){
$('#action-success').show();
}
//------------
})(jQuery);