Categories
FreeTextBox JavaScript

Kendo UI Editor – A FreeTextBox Replacement

The Kendo UI Editor is simple to use and easy to implement. I found it to be a great FreeTextBox replacement, the editor that I’ve used in the past. Here are a few reasons: Kendo editor is configured client-side in the JavaScript Kendo editor doesn’t rely on a server side control on the page, allows […]

Categories
JavaScript JQuery

Cache JQuery Selectors To Improve Performance

An easy way to improve jQuery performance is to cache reused jQuery selectors. This prevents jQuery from having to search the entire DOM for each instance the selector is being used. For example, instead of this: $(document).ready(function() { $(‘#FName’).html(‘My First Name’); $(“#changeName”).click(function() { $(‘#FName’).html(‘My Other First Name’); }); }); Try this: $(document).ready(function() { var fName […]

Categories
JavaScript

Values considered false in JavaScript – false, null, undefined, NaN

The false values in JavaScript: false null undefined The empty string ” The number 0 The number NaN (result of an operation that cannot produce a normal result) False JavaScript Values (JSFiddle) All other values evaluate to true, including true, the string ‘false’, and all objects. Another tidbit about NaN is that it is not […]

Categories
JavaScript

Simple way to understand the difference between JavaScript, JScript, & ECMAScript

JavaScript is a prototype-based scripting language that is dynamic, weakly typed and was formalized in the ECMAScript language standard. JScript is the Microsoft implementation of the ECMA 262 language specification (Source). ECMAScript is the scripting language standardized by Ecma International and is widely used for client-side scripting on the web. Here’s a good explanation.

Categories
HTML JavaScript

Boolean object in JavaScript

The Boolean object represents two values either “true” or “false”. new Boolean(value); If value parameter is omitted, 0, -0, null, false, NaN, undefined, or the empty string (“”), the object has an initial value of false due to automatic type coercion. Here’s a simple test for the JavaScript boolean object, here’s the HTML anchor tag […]

Categories
JavaScript

Check if Javascript function exists

Here’s a way to check to see if a function exist before calling it. if (typeof(functionName) != “undefined”) {    functionName(); // safe to use the function }

Categories
ASP.NET C# JavaScript VB.NET

Inline IF’ Statement

C# string s; s = (true ? “True” : “False”); //s will be “True” VB.NET Dim s As String s = If(True, “True”, “False”) ‘s will be “True” ‘In the following you cannot rely on a particular function ‘not being called if the other argument is selected by Expression ‘(notice IIf vs. If) s = […]