{"id":1093,"date":"2010-06-14T22:20:30","date_gmt":"2010-06-14T16:50:30","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=1093"},"modified":"2010-06-14T22:22:04","modified_gmt":"2010-06-14T16:52:04","slug":"jquery-alert-message-without-using-traditional-javascript-alert-box","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/jquery-alert-message-without-using-traditional-javascript-alert-box\/","title":{"rendered":"jQuery Alert Message without using traditional javascript alert-box."},"content":{"rendered":"<p>This post might help you if you want to display alert messages without using tradition javascript (irritating) alert.<br \/>\nTo achieve this you need jQuery for your frontend UI.<\/p>\n<p>Below is the javascript method (code snapshot) which displays your message for 5 seconds. And then fades out automatically.<\/p>\n<blockquote>\n<pre lang=\"javascript\">function displayAlertMessage(message) {\r\nvar timeOut = 5\r\njQuery('#messageBox').text(message).fadeIn()\r\njQuery('#messageBox').css(\"display\", \"block\")\r\nsetTimeout(function() {\r\njQuery('#messageBox').fadeOut()\r\njQuery('#messageBox').css(\"display\", \"none\")\r\n}, timeOut * 1000);\r\n}\r\n<\/pre>\n<\/blockquote>\n<p>messageBox is id of your div tag where you want to display the Alert Message.<br \/>\ntimeOut is number of seconds you want to hold message on screen.<br \/>\nThat&#8217;s it. So simple and quite comfortable from a user&#8217;s perspective Isn&#8217;t it? \ud83d\ude42<\/p>\n<p>Cheers!!<br \/>\nSalil Kalia<\/p>\n<p>\ufeff<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post might help you if you want to display alert messages without using tradition javascript (irritating) alert. To achieve this you need jQuery for your frontend UI. Below is the javascript method (code snapshot) which displays your message for 5 seconds. And then fades out automatically. function displayAlertMessage(message) { var timeOut = 5 jQuery(&#8216;#messageBox&#8217;).text(message).fadeIn() [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":16},"categories":[1],"tags":[282,55,27],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1093"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=1093"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1093\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=1093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=1093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=1093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}