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 1200 posted 15 years ago by joshuamilford
An implementation of class inheritance in JavaScript.
0 999 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 1156 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 1540 posted 15 years ago by bryanlyman
prop(obj); //usually use "$(str).appendTo(''#ul")
0 872 posted 15 years ago by anobre
Create log.txt in scripts directory and set permissions to 0666 before use.
0 1075 posted 15 years ago by Nek
Use this function to test whether or not a Javascript object is empty.
2 1352 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 1890 posted 16 years ago by elugardo
Detect if an object exists in an array or detect existance of a key in an object
1 1016 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 881 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 1171 posted 16 years ago by wizard04
actionscript date object and some date calculations
1 1127 posted 16 years ago by stiobhart
this will loop through an object and get all its properties
0 989 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 1688 posted 16 years ago by garside
Use this to dynamically copy objects.
0 1044 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 1116 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 1357 posted 16 years ago by chavcho
object.forEach ========= *Requires JavaScript 1.8* `void object.forEach(function callback(item, value)[, thisObject])`
0 997 posted 16 years ago by Sephr
this funciton returns an XMLHttpRequest object for use in ajax pages
1 1204 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 1664 posted 16 years ago by eden159
Simple snippet to return the keys of an object.
1 1359 posted 16 years ago by garside