Welcome To Snipplr


Everyone's Recent Snippets Tagged object



Notes to self: re-use this for other projects
0 632 posted 11 years ago by abbey
I include this in anything I'm developing, so I can easily inspect the contents of arrays and objects.
0 345 posted 11 years ago by joshuamilford
An implementation of class inheritance in JavaScript.
0 309 posted 11 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 375 posted 12 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 535 posted 12 years ago by bryanlyman
prop(obj); //usually use "$(str).appendTo(''#ul")
0 238 posted 12 years ago by anobre
Create log.txt in scripts directory and set permissions to 0666 before use.
0 352 posted 12 years ago by Nek
Use this function to test whether or not a Javascript object is empty.
2 467 posted 12 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 557 posted 12 years ago by elugardo
Detect if an object exists in an array or detect existance of a key in an object
1 321 posted 12 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 274 posted 12 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 408 posted 12 years ago by wizard04
actionscript date object and some date calculations
1 349 posted 12 years ago by stiobhart
this will loop through an object and get all its properties
0 263 posted 12 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 583 posted 12 years ago by garside
Use this to dynamically copy objects.
0 354 posted 12 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 308 posted 12 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 450 posted 12 years ago by chavcho
object.forEach ========= *Requires JavaScript 1.8* `void object.forEach(function callback(item, value)[, thisObject])`
0 312 posted 12 years ago by Sephr
this funciton returns an XMLHttpRequest object for use in ajax pages
1 377 posted 12 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 495 posted 13 years ago by eden159