Welcome To Snipplr

Everyone's Recent Snippets Tagged object

Notes to self: re-use this for other projects
0 919 posted 13 years ago by abbey
I include this in anything I'm developing, so I can easily inspect the contents of arrays and objects.
0 500 posted 13 years ago by joshuamilford
An implementation of class inheritance in JavaScript.
0 435 posted 13 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 513 posted 13 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 771 posted 13 years ago by bryanlyman
prop(obj); //usually use "$(str).appendTo(''#ul")
0 330 posted 13 years ago by anobre
Create log.txt in scripts directory and set permissions to 0666 before use.
0 476 posted 13 years ago by Nek
Use this function to test whether or not a Javascript object is empty.
2 660 posted 13 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 789 posted 13 years ago by elugardo
Detect if an object exists in an array or detect existance of a key in an object
1 446 posted 13 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 357 posted 13 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 546 posted 13 years ago by wizard04
actionscript date object and some date calculations
1 502 posted 13 years ago by stiobhart
this will loop through an object and get all its properties
0 385 posted 13 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 809 posted 14 years ago by garside
Use this to dynamically copy objects.
0 480 posted 14 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 441 posted 14 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 637 posted 14 years ago by chavcho
object.forEach ========= *Requires JavaScript 1.8* `void object.forEach(function callback(item, value)[, thisObject])`
0 438 posted 14 years ago by Sephr
this funciton returns an XMLHttpRequest object for use in ajax pages
1 544 posted 14 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 716 posted 14 years ago by eden159