milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home
  3. JavaScript

Create an array of objects

Details
Written by: Stanko Milosev
Category: JavaScript
Published: 26 August 2012
Last Updated: 26 August 2012
Hits: 4305
var tableProperties = {
    aoColumns: []
};

for (var i = 0; i < 9; ++i) {

    var obj = {
        _origColumnPosition: i
    };
    tableProperties.aoColumns.push(obj);
}

Prototype a string

Details
Written by: Stanko Milosev
Category: JavaScript
Published: 25 August 2012
Last Updated: 25 August 2012
Hits: 4327
    String.prototype.test = function () {
        alert('prototype');
    }

    var a = "";
    a.test();

False is not defined

Details
Written by: Stanko Milosev
Category: JavaScript
Published: 05 August 2012
Last Updated: 27 August 2012
Hits: 4867

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

 

Check members of object

Details
Written by: Stanko Milosev
Category: JavaScript
Published: 12 May 2011
Last Updated: 23 May 2012
Hits: 4868
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.

  1. Document.Cookie Property Returns an Empty String
  2. Increasing day and formating date time
  3. Add Single Click Action To A Node In A TreePanel
  4. Attach event on dynamically added HTML

Subcategories

Ajax

JavaScript

ExtJS


jQuery

Bing Maps AJAX Control, Version 7.0

Knockout

Jasmine

Moment

node.js

Page 8 of 24

  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12