Condividi tramite


Type.getName Method

Returns the name of the type of the instance.

var typeNameVar = typeInstanceVar.getName();

Return Value

A string representing the fully qualified name of the type of the instance.

Remarks

Use the getName method to get the name of the type of the instance. The getName method is invoked from the object that you want to retrieve the type name for. The type name that is returned is fully qualified; it consists of a namespace specification and a type name.

Example

The following example shows how to retrieve the registered components in an application and how to retrieve their ID and type information.

function listComponents() {
    var c = Sys.Application.getComponents();
    var s = "";
    for (var i=0; i<c.length; i++) {
        var id = c[i].get_id();
        var type = Object.getType(c[i]).getName();
        s += 'Item ' + i + ': id=' + id + ', type=' + type + '.<br />';
    }
    div1.innerHTML = s;
}

See Also

Reference

Type Class