javascript - My displayError() function is not working at all -


i made function should display error or remove error.

unfortunately, when use function in way, example displayerror(true, "test");, it's not working.

when check html code see if changes, nothing changed.

function displayerror(display, string, xhr) {     $("div#error").fadeout(300, function() {         if(arguments.length == 1 && typeof display === "boolean" && display == false) {             //do nothing         } else if(arguments.length == 2 && typeof display === "boolean" && display == true && typeof string == "string") {             $("div#error").html('<b style="color: #ce1919;">(!)</b> '+string).fadein(300);         } else if(arguments.length == 3 && typeof display === "boolean" && display == true && typeof string == "string" && typeof xhr === "object") {             $("div#error").html('<b style="color: #ce1919;">('+xhr.status+")</b> "+string).fadein(300);         }     }); } 

anybody can identify problems?

use  typeof display === "boolean" typeof xhr === "object" 

hope helps.

reference


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -