Welcome To Snipplr


Everyone's Recent JavaScript Snippets Tagged object



This code works for me without requiring any includes, plugins, or service packs. It should also integrate seamlessly with jquery. If needing to perform this process more than once on a page, make sure namedListItem variable is unique for each case (...
0 879 posted 13 years ago by rumremix
This code works for me without requiring any includes, plugins, or service packs. It should also integrate seamlessly with jquery.
0 775 posted 13 years ago by rumremix
SimpleSelector is a small DOM selector object with support for the most used selectors. It's also the default selector for the jLim JavaScript framework. Why use SimpleSelector? - very small, less than 2kb minified - easy to use with $$() - no...
1 760 posted 14 years ago by freelancephp
0 414 posted 14 years ago by tennison
An implementation of class inheritance in JavaScript.
0 542 posted 14 years ago by wizard04
prop(obj); //usually use "$(str).appendTo(''#ul")
0 419 posted 14 years ago by anobre
Use this function to test whether or not a Javascript object is empty.
2 842 posted 14 years ago by jlizarraga
The code below will loop through the properties in an object and alert a string. myObject is in JSON notation. The "for ( x in y)" construct does not work if the Prototype.js library is included on the page
0 1035 posted 14 years ago by elugardo
Detect if an object exists in an array or detect existance of a key in an object
1 567 posted 14 years ago by quickredfox
Runtime Object Evaluator; search for string object properties that start with !! and eval the content. Very useful if you want to load JSON from file and evaluate its fields on effective usage or access global variables at runtime. [Follow me on T...
1 460 posted 14 years ago by straps
object.forEach ========= *Requires JavaScript 1.8* `void object.forEach(function callback(item, value)[, thisObject])`
0 539 posted 15 years ago by Sephr
this funciton returns an XMLHttpRequest object for use in ajax pages
1 684 posted 15 years ago by jlvallelonga
Everything works as expected for the setTimeout() function until you try to call a method inside your ‘class’ (there are no real classes in JavaScript). Something like this won’t work: setTimeout(this.methodToCall, time); Passing a string r...
0 972 posted 15 years ago by eden159
1 574 posted 15 years ago by ezerick
Every function has an object called the arguments object. This is an object that contains all the arguments that were passed to the function. The example below shows how to access these. Very rarely used but useful to know. Note: it may look like an...
2 708 posted 16 years ago by 1man
Create a simple object and add properties and a method. Note where the object is parsed (not from top to bottom).
2 608 posted 16 years ago by 1man
Shows you how to link 2 objects together via the object function. If a value isn't found in the object, it will look for it in the linked object.
0 518 posted 17 years ago by 1man
Extend a custom object, and a pre-defined object(e.g. string) using .prototype available in JS.
1 631 posted 17 years ago by 1man
This functions allows you to create a new XMLHTTPRequest, it checks to see if the browser supports each method, if not it returns false.
4 933 posted 17 years ago by 1man
Helps identify correctly the type of whatever you put as an argument. This was adapted from http://www.planetpdf.com/developer/article.asp?ContentID=testing_for_object_types_in_ja
3 722 posted 17 years ago by rolandog
javascript in_array object frame. Usar: Mediceau.Navegacion.marcar(['nav1','nav2']) ... _--Nav 1 _--Nav 2 _--Nav 3 _--Nav 4
0 610 posted 17 years ago by nicolaspar
1 616 posted 17 years ago by mlange