Welcome To Snipplr


Everyone's Recent Snippets Tagged object



I include this in anything I'm developing, so I can easily inspect the contents of arrays and objects.
0 1243 posted 15 years ago by joshuamilford
An implementation of class inheritance in JavaScript.
0 1020 posted 15 years ago by wizard04
A class which wraps a parent list containing mixed object types, to provide smaller strongly typed sub-lists of objects. These sub-lists can be modified, which then modifies the parent list concurrently (without events being triggered). Supports the...
0 1185 posted 15 years ago by bryanlyman
For .net 2.0+ The one limitation to enumerations is revealed when you try to reverse lookup an enumeration value using Enum.Parse(). The parse function will return an inconsistent enum object if ever there are two or more enumerations with the same...
0 1574 posted 15 years ago by bryanlyman
prop(obj); //usually use "$(str).appendTo(''#ul")
0 905 posted 15 years ago by anobre
Create log.txt in scripts directory and set permissions to 0666 before use.
0 1108 posted 15 years ago by Nek
Use this function to test whether or not a Javascript object is empty.
2 1454 posted 16 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 2475 posted 16 years ago by elugardo
Detect if an object exists in an array or detect existance of a key in an object
1 1039 posted 16 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 910 posted 16 years ago by straps
For cross-browser code--which is not necessarily valid--the [Embedded Media HTML Generator](http://cit.ucsf.edu/embedmedia/step1.php) provides a great starting point.
1 1232 posted 16 years ago by wizard04
actionscript date object and some date calculations
1 1160 posted 16 years ago by stiobhart
this will loop through an object and get all its properties
0 1014 posted 16 years ago by stiobhart
Used to share between a single instance of jQuery through iFrames. Do note, the iFrame content must originate from the same domain, or this plugin will NOT work as expected.
4 1714 posted 16 years ago by garside
Use this to dynamically copy objects.
0 1076 posted 16 years ago by allnatural
If you have a component being bound from an ObjectDataSource (like a drop-down menu, or a grid view) and you wish to change the value's SelectParameters. Where # is which SelectParameter you'd like to change. If there's just one SelectParamter, defau...
0 1133 posted 16 years ago by blackf0rk
Serializes any <serializable/> object and writes it to the specified location on the disk. Example: Dim obj As DataTable 'save obj to disk SerializeToFile(filepath, obj) 'to read it back, use DirectCast Dim obj2 As DataTable = DirectCast(...
0 1399 posted 16 years ago by chavcho
object.forEach ========= *Requires JavaScript 1.8* `void object.forEach(function callback(item, value)[, thisObject])`
0 1031 posted 16 years ago by Sephr
this funciton returns an XMLHttpRequest object for use in ajax pages
1 1294 posted 16 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 1762 posted 16 years ago by eden159
Simple snippet to return the keys of an object.
1 1386 posted 16 years ago by garside