All Products
© Copyright 2019|winbytes.org.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the uncaught typeerror is not a function company Business Learn more about hiring developers or posting ads with us Stack Overflow settimeout Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 'Uncaught TypeError: boolean is not a function' up vote 1 down vote favorite I have a button that removes banner on click. I wanted to add a dialog which will ask for confirmation if user has accidentally clicked on the button. I added this code(I've used it so many times and every time it worked): $('.rem_cover_btn').click(function(){ confirm = confirm("Are you sure you want to remove your banner?"); if(confirm){ window.location='../modules/user/removeBanner.php'; } }); And when I click on the button, the dialog box comes up and if I click 'Cancel' and repeat that action, dialog box won't show, I just get this message in Chrome Development Console: Uncaught TypeError: boolean is not a function' So: 'Remove Banner' button click > Cancel action > Again click on the button > Error is displayed I don't know why does it work for the first time and every time after that I get that error. jquery html share|improve this question asked Aug 5 '14 at 18:53 Vlada903 464416 6 Use var and don't name your variables the same as existing functions or you will have a bad time. –asawyer Aug 5 '14 at 18:54 1 Don't be a Cargo cult programmer –asawyer Aug 5 '14 at 18:56 @asawyer Sorry, but I'm not a Cargo cult programmer. I didn't just paste the code. I'm 16 and making an advanced website(for me) isn't so easy and not finding a little bug doesn't make me the Cc programmer. –Vlada903 Aug 5 '14 at 19:06 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted This line of code is overwriting the native confirm function confirm = confirm("Are you sure you want to remove your banner?"); It overwrites it with the result of confirm which is a boolean value. The next time this code executes, confirm is a b
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community http://stackoverflow.com/questions/25146243/uncaught-typeerror-boolean-is-not-a-function of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up boolean is not a function in javascript up vote 3 down vote favorite I have the following javascript where I am reading in a word and writing out a translation, but I keep getting the http://stackoverflow.com/questions/16045480/boolean-is-not-a-function-in-javascript error boolean is not a function function translate() { var word = $("#prodId").val(); $.getJSON("api/translation?word=" + word, function (data) { $("#word").text(data.TranslatedWord); }) .fail( function (jqXHR, textStatus, err) { $("#word").text('Error: ' + err); }); } The following method which is basically the same thing, but uses an integer works fine: function find() { var id = $("#prodId").val(); $.getJSON("api/products/" + id, function (data) { var str = data.Name + ': $' + data.Price; $("#product").text(str); }) .fail( function (jqXHR, textStatus, err) { $("#product").text('Error: ' + err); }); } Here is a snippet of the HTML:
© Copyright 2019|winbytes.org.