- Details
- Written by: Stanko Milosev
- Category: JavaScript
- Hits: 4412
var tableProperties = {
aoColumns: []
};
for (var i = 0; i < 9; ++i) {
var obj = {
_origColumnPosition: i
};
tableProperties.aoColumns.push(obj);
}
- Details
- Written by: Stanko Milosev
- Category: JavaScript
- Hits: 4422
String.prototype.test = function () {
alert('prototype');
}
var a = "";
a.test();
- Details
- Written by: Stanko Milosev
- Category: JavaScript
- Hits: 4976
In a view if you are receiving error: False is not defined, then you probably have to transfer you variable to low string, something like:
var doAboutTab = @((ViewBag.DoAboutTab != null).ToString().ToLower());
Taken from here
- Details
- Written by: Stanko Milosev
- Category: JavaScript
- Hits: 4975
function dumpProps(obj, parent) {
// Go through all the properties of the passed-in object
for (var i in obj) {
// if a parent (2nd parameter) was passed in, then use that to
// build the message. Message includes i (the object's property name)
// then the object's property value on a new line
if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
// Display the message. If the user clicks "OK", then continue. If they
// click "CANCEL" then quit this level of recursion
if (!confirm(msg)) { return; }
// If this property (i) is an object, then recursively process the object
if (typeof obj[i] == "object") {
if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
}
}
}
With this function we can check what one object content.