X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Fcore-common.js;h=3dc1d749c6c171fc8cd8c7b0b6210493e35261f7;hb=d1cf572ce023d55e2dbb810d1d6f9301c3d4e3db;hp=77d08f337b936b3b17662e5ad2c32b3c9f0c0927;hpb=e94d69d6bc8bbd41de354b3a9194428631d0e8f8;p=mailer.git diff --git a/js/core-common.js b/js/core-common.js index 77d08f337b..3dc1d749c6 100644 --- a/js/core-common.js +++ b/js/core-common.js @@ -7,7 +7,7 @@ * $Author:: $ * -------------------------------------------------------------------- * Copyright (c) 2003 - 2009 by Roland Haeder - * Copyright (c) 2009 - 2012 by Mailer Developer Team + * Copyright (c) 2009 - 2013 by Mailer Developer Team * For more information visit: http://mxchange.org * * This program is free software; you can redistribute it and/or modify @@ -34,7 +34,7 @@ function in_array (needle, heystack) { // Check all elements for (var i = 0; i < heystack.length; i++) { // Is the element found? - if (heystack[i] == needle) { + if (heystack[i] === needle) { // Found it and abort isInArray = true; break; @@ -56,3 +56,18 @@ function decodeUrlEncoding (content) { // Return it return decoded; } + +// "Getter" for total elements in given object +function getTotalCountFromObject (object) { + // Default is zero + var total = 0; + + // Start looping + $.each(object, function (i, j) { + // Add it + total++; + }); + + // Return total + return total; +}