9 Reusable Code Snippet Topics

Remove Filter
Member Avatar for Troy III

Will work on latest:Chrome Safari Firefox Opera and all versions of IE. *(client notifications are for demonstration purposes only, and subject to designer decisions and modifications ) Can be used for size and mime-type restrictions. When mime-type is not an issue, accepting any kind of image format can be done …

Member Avatar for Troy III
2
3K
Member Avatar for Troy III

# Determine if a namespace/variable-name exists # ## Check for namespace existence in your environment variables and objects before writing to them. ## **Guess if "Book1.chapter22.paragraph37" exists without provoking errors and retrieve/send data if it exists with simplest JS expressions.** Call syntax: isNS( [string], [num] ); Example: var nsresult = …

Member Avatar for Troy III
0
310
Member Avatar for Troy III

This code enables you to publish a CSS only with mouse click and keyboard tab image swap. Attached is a Demo example of how it would look on IE6. To ensure the greatest possible cross-browser compatibility/support this code uses CSS level 1 capabilities only. One of extra benefits is that …

Member Avatar for pol.bala
7
2K
Member Avatar for Troy III

# This is a simple HTML String Sanitizing tool. # ## It allows a highly rich,- but safe - html content input to be published on your pages. ## **The script code is very light and to some degree customizable.** * This function takes care of blacklisted tags, which are …

Member Avatar for Troy III
2
274
Member Avatar for Troy III
Member Avatar for Troy III

With this *Spartan*, we can destructively disable all the links on the page. (Or whatever link collection we feed the Fn.arg.)

Member Avatar for Troy3
0
185
Member Avatar for Troy III

We know we already have built-in [I]Trim methods[/I], but trimming doesn't get rid of internal, (and unwanted) extra spaces. -So this is where Normalize method comes to play. It trims left, it trims right, but most importantly it also trims on the inside, one could say: "it trims inside-out". In …

Member Avatar for Troy III
0
324
Member Avatar for Troy III

[I][COLOR="Green"]!below is the code snippet [/COLOR][/I] This is a multi-use property toggler. In the given example we are toggling a sub property of an element. e -is the property owner to be targeted; p - is the property name to be set; v - is the property value; henceforward changing …

Member Avatar for Airshow
0
246
Member Avatar for Troy III

Since the Firefox [Bug 633133] of the [B]in[/B] operator on DOM Collections has ben finally fixed - We can now write a short fast and clean function of the method "Contains" for FirefoX to check if x.contains(y). And vice- versa. What we will need is: a prototype and we'll chose …

Member Avatar for Troy III
0
631

The End.