Java Script Quick Tutorial
3.8. Getting deep 'Button' information

Usefull function : DeepListAllProperties

Copy of the javascript code :

function DeepListAllProperties ( Object , ObjectName , DeepMax )
{
   //----- Debug only
   /*document.write ( "Called : DeepListAllProperties ( "
                  + Object + " , "
                  + ObjectName + " , "
                  + DeepMax +" );<br>" );*/

   //----- Controls.
   if ( DeepMax <= 0 )
      return ;
   if ( ObjectName == "window.external" )
      return ;

   var Result = ""

   //----- Loop on all properties.

   for (var i in Object)
   {
      if (    ( i == "innerHTML" ) // Don't show this properties,
           || ( i == "outerHTML" ) // because they redefine the forms,
           || ( i == "innerText" ) // or they are too long.
           || ( i == "outerText" ) )
         Result = ObjectName + "." + i + " = " + "<i>Not shown ( too long, or redefines the object )</i><br>"
      else
         Result = ObjectName + "." + i + " = " + Object[i] + "<br>" ;
      document.write ( Result );

      //----- If ok, do the recursive call.
      if ( DeepMax > 1 )                            // Do the recursive call only if DeepMax > 1
         if ( typeof ( Object[i] ) == "object" )    // Do the recursive call only for objects
            if ( Object[i] != null )                 // Do the recursive call only for non null objects
               if (    ( i != "external" )          // For unknow reasons,
                   && ( i != "parent" )             // this objects don't support the recursive call.
                   && ( i != "self" )
                   && ( i != "top" )
                   && ( i != "window" )
                   && ( i != "mimeTypes" )
                   && ( i != "opsProfile" )
                   && ( i != "plugins" )
                   && ( i != "userProfile" )
                   && ( i != "all" ) )
               {

                  //----- Do the recursive call.
                  DeepListAllProperties ( Object[i] , ObjectName + "." + i , DeepMax - 1 );
               }
   }
}

Form1 definition

This is Form1

ScrollingTextBox1

Checkbox1

RadioGroup1
RadioButton1

'Form1.Button1' information, deep 2 :

Copy of the javascript code :

DeepListAllProperties ( Form1.Button1 , "Button1" , 2 );

Result :

 

Hosted by www.Geocities.ws

1