473,394 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to find Class Name of an object?

Creating a method of object (Object.prototype.classOf ...) is not the
correct way because of a (as expected) flaw in IE where DOM Elements
does not inherit from Object.

As a result it is best to create a stand alone method passing the
object as an argument:

~~~~ CODE ~~~~

<div id=divTest></div>
<script>
// Optimized method to get class name of object
function oGetClassOf(o){
var a=/function\s+(.+)\s*\(\)\s*\{/.exec(o.constructor)
return (a && a[1] ? a[1] : 'Unknown')
}

// debug stuff
function writeClassOf(o){
document.write(oGetClassOf(o)+"<br>")
}
function myClass() { this.x = 1; this.y = 2; }
writeClassOf(new myClass())
writeClassOf(new String())
writeClassOf([])
writeClassOf({})
writeClassOf(myClass)
writeClassOf(getElem("divTest"))
</script>

~~~~ END ~~~~

Cheers!
JsD

Note - This is a Continuation of thread:
http://groups.google.com/group/comp....c4c07198ed01d7

Dec 5 '05 #1
16 3053
Java script Dude wrote:
Creating a method of object (Object.prototype.classOf ...) is not the
correct way
Wrong. It is the correct way.
because of a (as expected) flaw in IE where DOM Elements
does not inherit from Object.
So you let a peculiarity of the IE DOM define what is "correct"
regarding the programming language? YMMD.
As a result it is best to create a stand alone method passing the
object as an argument:
It is not.
[...]
<div id=divTest></div>
<script>
Invalid HTML. <URL:http://validator.w3.org/>
// Optimized method to get class name of object
function oGetClassOf(o){
JavaScript < 2/JScript < .NET/ECMAScript < 4, as implemented in browsers,
do not have classes. That is why there is the `prototype' reference.
var a=/function\s+(.+)\s*\(\)\s*\{/.exec(o.constructor)
return (a && a[1] ? a[1] : 'Unknown')
}
Did it occur to you that a simple `tagName' property reference may have
sufficed for DOM objects?
Note - This is a Continuation of thread:

http://groups.google.com/group/comp....c4c07198ed01d7

This is nonsense. The thread could and should have been _really_ continued.
Please learn how to post on Usenet. Use Options, Reply for Google Groups.
PointedEars
Dec 7 '05 #2
>> because of a (as expected) flaw in IE where DOM Elements
does not inherit from Object.
So you let a peculiarity of the IE DOM define what is "correct"
regarding the programming language? YMMD.
Unfortunately, in the corporate world, IE is a fact that cannot be
avoided. MS has sucessfully created issues for all of us JS hackers and
we must work within their domain.

If you use a objects method as the original example suggests, you will
have to do the following statement for testing if object is an array:

if(o && o.getClassOf && o.getClassOf() == "Array"){...

With my example:
if(oGetClassOf(o)=="Array"){...

I'd say this my example is much more useful for JavaScript as it is
short and consice and will work in all browsers. The only disadvantage
is the loss of JS namespace.

Another advantage of using a standalone function is that the function
can be tuned to be immune to null (undefined) attributes.
<div id=divTest></div>
<script>

Invalid HTML. <URL:http://validator.w3.org/>
I was not writing on how to write standards based html. I was writing a
minimal amount of html to get the JS to run. Get a grip!
Did it occur to you that a simple `tagName' property reference may have sufficed for DOM objects?

No - See above example. Short an consise is the key to good JS.
This is nonsense. The thread could and should have been _really_ continued. Please learn how to post on Usenet. Use Options, Reply for Google
Groups.
From what I can see, the original thread is closed and cannot be

continued. I have seen many others using the technique that I used and
found that it is an effective way of sharing knowledge.

If I am missing something maybe you could give some insight on how to
best continue a thread that is closed.

JsD

[:==OSX+Moz+OOo==:]

Dec 18 '05 #3
Java script Dude wrote:
^^^^^^^^^^^^^^^^
Even your nickname talks volumes. Java != JavaScript. (Which includes,
but is not limited to, that it is not necessary to create String objects
as you did before.)
because of a (as expected) flaw in IE where DOM Elements
does not inherit from Object. So you let a peculiarity of the IE DOM define what is "correct"
regarding the programming language? YMMD.


Unfortunately, in the corporate world, IE is a fact that cannot be
avoided. MS has sucessfully created issues for all of us JS hackers


You are not a JS hacker. You are a script-kiddie.
and we must work within their domain.
No, "we" must not. And "we" need not to and still be successful. And,
IE is not even the point here.

What you have still not understood is that JScript as implemented in IE
is an ECMAScript implementation, a prototype-based programming language.
JavaScript as supported since NN2, and now in Mozilla/5.0, is another
ECMAScript implementation.

DOM objects are host objects, they are not part of either language
(unfortunately that distinction was made in JavaScript not before version
1.4) and do not need to implement many ECMAScript features as specified.
That is not a flaw, the "host object exception" is instead well specified
in ECMAScript and especially the IE DOM honors that very much (allowing
host object methods to return typeof "object" and allowing collections
like `document.all' to be used like methods, for example.)

Allowing a peculiarity of one DOM/UA to define your programming style is
probably the greatest sign of incompetence you could possibly display.
If you use a objects method as the original example suggests, you will
have to do the following statement for testing if object is an array:

if(o && o.getClassOf && o.getClassOf() == "Array"){...

With my example:
if(oGetClassOf(o)=="Array"){...
Current ECMAScript implementations in user agents (UAs) have no classes;
the only production-ready ECMAScript implementation supporting class-based
inheritance is JScript.NET (JScript 7.0) for ASP.NET on IIS (server-side).

Array objects are not host objects as HTMLDivElement objects are, they
are core objects. Therefore, for Array objects, a simple

if (o instanceof Array)

(since JavaScript 1.5 [Mozilla/5.0], JScript 5.0 [IE5], ECMAScript 3) or

if (o.constructor == Array)

(since JavaScript 1.1 [NN3], JScript 2.0 [IIS3/IE3], ECMAScript 1) suffices
for this test. There is no unreliable RegExp parsing necessary at all.
I'd say this my example is much more useful for JavaScript as it is
short and consice and will work in all browsers.
In all browsers that you have tested with, perhaps. Which are most
certainly not many.
The only disadvantage is the loss of JS namespace.
You are relying merely on the implementation of the toString() method of
Function objects that is _known_ to differ between UAs, which is the main
disadvantage. Relying on it can be considered harmful. The method may
be nice for educational purposes, it is certainly not for practical use.
Another advantage of using a standalone function is that the function
can be tuned to be immune to null (undefined) attributes.
null != undefined, and attributes not defined in the DOM have the value
of `undefined' in all known DOMs, which can be easily tested for:

typeof foo.attribute != "undefined"

or

foo.attribute != undefined

with the provision for the latter that the `undefined' property of the
Global Object may have been user-defined before (sounds strange but is so):

// global context
var undefined = undefined;

But probably you did not even refer to attributes of elements but to
"attributes" of objects. FYI: In ECMAScript implementations, objects
have _properties_. And it is not possible with your method to test if
a property is undefined or its value is `undefined' (which is the same
on read access) as `undefined' has no properties, not even `constructor'.
See previous discussions.
<div id=divTest></div>
<script>

Invalid HTML. <URL:http://validator.w3.org/>


I was not writing on how to write standards based html. I was writing a
minimal amount of html to get the JS to run. Get a grip!


You were talking nonsense before, and you are talking nonsense again.
Script code used in not Valid markup is not likely to work as supposed,
being non-interoperable per se. Invalid examples are useless.
Did it occur to you that a simple `tagName' property reference may have
sufficed for DOM objects?


No - See above example. Short an consise is the key to good JS.


Hello?

alert(document.getElementById('divTest').tagName)) ; // div

as opposed to

alert(oGetClassOf(document.getElementById('divTest '))));

which will probably not work in IE (HTMLDivElement objects should have
no constructor property there if they do not inherit from Object), and
which will force time-consuming method calls and RegExp replacement
that will probably have no usable result all, that is 'Unknown', which
is not true. Big time.

And in IE you could even do

alert(divTest.tagName);

(as the IE-DOM makes named/IDed elements, spoiling the global namespace).
So far for conciseness.
If I am missing something maybe you could give some insight on how to
best continue a thread that is closed.


You have not even understood what medium you are really using, what
Usenet is. "continue a thread that is _closed_". YMMD again.

<URL:http://en.wikipedia.org/wiki/Usenet>
PointedEars, amused
Dec 18 '05 #4
VK

Java script Dude wrote:
a (as expected) flaw in IE where DOM Elements
does not inherit from Object.


Could you elaborate on this? You mean to say that in some browsers DOM
elements *do* extend JavaScript Object object? Or what do you mean by
"DOM elements" then?

Dec 18 '05 #5
Thomas 'PointedEars' Lahn said the following on 12/18/2005 2:23 PM:
Java script Dude wrote:
^^^^^^^^^^^^^^^^
Even your nickname talks volumes. Java != JavaScript. (Which includes,
but is not limited to, that it is not necessary to create String objects
as you did before.)
Now your pedantics reach to nicknames? First, you are assuming that its
a nickname in the English sense, it is not. It is an alias. If you want
to be pedantic, lets be pedantic.
because of a (as expected) flaw in IE where DOM Elements
does not inherit from Object.

So you let a peculiarity of the IE DOM define what is "correct"
regarding the programming language? YMMD.
Unfortunately, in the corporate world, IE is a fact that cannot be
avoided. MS has sucessfully created issues for all of us JS hackers

You are not a JS hacker. You are a script-kiddie.


Coming from you, thats a joke.
and we must work within their domain.

No, "we" must not. And "we" need not to and still be successful. And,
IE is not even the point here.


OK PointedHead, if you want scripts to work in IE, you *will* play by
IE's rules.
What you have still not understood is that JScript as implemented in IE
is an ECMAScript implementation, a prototype-based programming language.
JavaScript as supported since NN2, and now in Mozilla/5.0, is another
ECMAScript implementation.
And what YOU have not understood is that ECMA was an attempt to
standardize the languages in IE and NN. ECMAScript is a subset of
Javascript and JScript. It started that way and remains that way.

<snip>
I'd say this my example is much more useful for JavaScript as it is
short and consice and will work in all browsers.

In all browsers that you have tested with, perhaps. Which are most
certainly not many.


And now you know how many browsers people have to test with? Wow. OK,
tell me how many I have to test with at my disposal?
The only disadvantage is the loss of JS namespace.

You are relying merely on the implementation of the toString() method of
Function objects that is _known_ to differ between UAs, which is the main
disadvantage. Relying on it can be considered harmful. The method may
be nice for educational purposes, it is certainly not for practical use.


No, to write practical scripts you *must* know the peculiarities of the
browsers. That is Reality. Theory is your domain, stick to it. You suck
at Reality Thomas.
<div id=divTest></div>
<script>

Invalid HTML. <URL:http://validator.w3.org/>


I was not writing on how to write standards based html. I was writing a
minimal amount of html to get the JS to run. Get a grip!

You were talking nonsense before, and you are talking nonsense again.
Script code used in not Valid markup is not likely to work as supposed,
being non-interoperable per se. Invalid examples are useless.


OK which is it Thomas? Just a day or two ago you posted untested broken
code and your defense was that it was to others to test and validate it.
Now, you say people should post valid/tested code. The term for that is
hypocritical.

Troll elsewhere.

<snip>
If I am missing something maybe you could give some insight on how to
best continue a thread that is closed.

You have not even understood what medium you are really using, what
Usenet is. "continue a thread that is _closed_". YMMD again.


Depends on your definition and concept of a thread being closed. In the
sense that you can reply to any thread in Usenet, it is not "closed" in
that sense. In the sense that the discussion appears to be finished then
it can be considered "closed". Before you decide to be pedantic about
language usage, you should know that language is not definitive. It
evolves and different dialects muddy it up. And that is quite easy to
prove. Tell me what the following statement means:

"Lets go blow a fag away".
<URL:http://en.wikipedia.org/wiki/Usenet>


You need better references that are more reliable and more dependable
for accuracy.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

Dec 18 '05 #6
Yes, In Mozilla, a DOM element inherits from Object. I am not sure if
this is the ECMA Script way but it does.

eg
Object.prototype.doThis=function OP_doThis(v){...

var elem=document.getElementById("divTest")

elem.doThis("whatever")

This actually works in Mozilla which means that Dom Element extends
Object. IE does not do this!

My customer only wants IE support but I program in Mozilla. I have not
tested in other browsers since my customer is not willing to pay for
that.

Dec 20 '05 #7
Good question. I think that it is the server that is hosting the usenet
node.

Dec 20 '05 #8
> Even your nickname talks volumes. Java != JavaScript. (Which includes,
but is not limited to, that it is not necessary to create String objects
as you did before.)
You are preaching to the choir.

Java script Dude is just a play on words in that I like both JavaScript
and Java. I know that they are different and am constantly correcting
people when they blend the two.
Array objects are not host objects as HTMLDivElement objects are, they
are core objects. Therefore, for Array objects, a simple
if (o instanceof Array)
There are flaws in instanceof operator in JavaScript when referencing
variables in child window. This flaw effects IE and mozilla. I have
tested in both and have concluded it is not stable enough to build good
code on. I would be glad to share a testcase that proves this.

Although I could probably get Mozilla to fix this, with IE there is
little chance in hell to get them to fix it. So, since I must support
IE, I will never depend on `instanceof` in my code.
if (o.constructor == Array)
I completely agree with the use of this method. And actually am
standing down on my backing of using a single getClassOf function in
any form. You are absolutely correct about the stability of depending
on toString() returns. Also, performance of string conversion and
processing a regular expression would theoretically be slower than
(o.constructor == ~OBJ~) which requires no conversions or complex
analysis.

With that said, I will suggest using the following boolean `is` methods
(eg isNaN() ).

I just plain love to have in my code since it makes for clear and
consice code.

function isArray(o){ return (o && o.constructor == Array) }
function isDate(o){ return (o && o.constructor == Date) }
function is...

With these boolean methods, you can make your code shorter and more
consise without having to validate nulls or undefined possibilities of
a variable.

Instead of code in JS:

if(o && o.constructor == Array){...

now we have:

if(isArray(o)){...
You are not a JS hacker. You are a script-kiddie.


Thems fighting words pal. You have made it clear in the past that you
have way too much time on your hands which is a sign of just how busy
you are. I my case, I write tons of JavaScript for my customers who are
not only extremely happy with my code because of its stability but they
are asking for more and more to the point where I don't have enough
time to share my knowledge.

But if I am just a script-kiddie now, I have a lot more to look forward
to :]

With that said, I do appreciate your comments and always take some
value from every opportunity to read responses from this forum.

JsD

Dec 20 '05 #9
Java script Dude wrote:
Good question.


/What/ is a "good question"? Please quote what you are replying to, and
trim quotes to the minimum required for preserving context.

<URL:http://jibbering.com/faq/faq_notes/pots1.html#ps1Post>
<URL:http://www.safalra.com/special/googlegroupsreply/>

[re-added quoting level]
Since when can threads "close"? Is this something that Google does?

I think that it is the server that is hosting the usenet node.


The question was a rhetoric one. Whatever you mean with "usenet node",
NetNews has a decentralized organization structure. There is not _the_
news server, there are many news servers feeding their articles to their
"peer" servers.

NetNews threads cannot be closed in the meaning of closing "threads" in
Web forums; they can only expire, that is, the oldest posting of that
thread expires on this particular news server, not necessarily on another.

However, even then you could reply to a posting that is still on your news
server (or in your archive, if it feeds new content back to NetNews, as
Google Groups does) and news servers will (have to) accept that reply.
Quoting more than usual from the article replied to then is usually a
Good Thing; how much should be quoted depends on the age of the precursor.
HTH

PointedEars
Dec 20 '05 #10
Java script Dude wrote:

Please provide attribution of quoted material.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Even your nickname talks volumes. Java != JavaScript. (Which includes,
but is not limited to, that it is not necessary to create String objects
as you did before.)
You are preaching to the choir.

Java script Dude is just a play on words in that I like both JavaScript
and Java. I know that they are different and am constantly correcting
people when they blend the two.


Still one wonders why you use Java techniques and terminology, like creating
String objects and using the term "class", in JavaScript for HTML-UAs.
Just a bad habit, I presume?
Array objects are not host objects as HTMLDivElement objects are, they
are core objects. Therefore, for Array objects, a simple
if (o instanceof Array)


There are flaws in instanceof operator in JavaScript when referencing
variables in child window. This flaw effects IE and mozilla. I have
tested in both and have concluded it is not stable enough to build good
code on. I would be glad to share a testcase that proves this.


Yes, please, that would turn out to be interesting either way.
Although I could probably get Mozilla to fix this, with IE there is
little chance in hell to get them to fix it. So, since I must support
IE, I will never depend on `instanceof` in my code.
I cannot follow your rationale, but I seldom use instanceof myself;
it is not downwards compatible (to JavaScript < 1.5, JScript < 5.0,
ECMAScript < Ed. 3).
With that said, I will suggest using the following boolean `is` methods
(eg isNaN() ).

I just plain love to have in my code since it makes for clear and
consice code.

function isArray(o){ return (o && o.constructor == Array) }
function isDate(o){ return (o && o.constructor == Date) }
function is...

With these boolean methods, you can make your code shorter and more
consise without having to validate nulls or undefined possibilities of
a variable.
Agreed. (It happens that my JSX:types.js already included isArray() :))
[...]
With that said, I do appreciate your comments and always take some
value from every opportunity to read responses from this forum.


ACK
PointedEars
Dec 20 '05 #11
Java script Dude wrote:
Yes, In Mozilla,
To be precise: in all UAs implementing the Gecko DOM.
a DOM element inherits from Object. I am not sure if
this is the ECMA Script way
_ECMAScript_ allows this behavior for host objects.
but it does.


Exactly.
PointedEars
Dec 21 '05 #12
The use of the oGetClassOf is a `cute` way of getting the class but
after review, the best way to detect a class type is to use global type
detection functions.

Quote from Douglas (JSON Dude) Crawford:
{ type:"Snip", source:
"http://www.crockford.com/javascript/remedial.html", text:"""\
[Type Detection]

Since JavaScript is a loosely-typed language, it is sometimes
necessary to examine an object to determine its type. (This is
sometimes necessary in strongly typed languages as well.) JavaScript
provides a typeof operator to facilitate this, but typeof has problems.
We are better off to wrap typeof in a set of global functions.

isAlien(a)

Internet Explorer holds references to objects which are not JavaScript
objects, and which produce errors if they are treated as JavaScript
objects. This is a problem because typeof identifies them as JavaScript
objects. The isAlien() function will return true if a is one of those
alien objects.
isArray(a)

isArray() returns true if a is an array, meaning that it was produced
by the Array constructor or by using the [ ] array literal notation.
isBoolean(a)

isBoolean(a) returns true if a is one of the boolean values, true or
false.\
"""}

Once again thanks Doug for your insightful hacks.

Kudos,
JsD
[: pardon tcl `\` and python `"""` identifiers in JSON construct. Just
wishful hacking on my part :]

Dec 21 '05 #13
Doooooh!

Thats Douglas (JSON Dude) Crockford not Crawford.

addHomerPoints({user: "JsD", n:5})

Dec 21 '05 #14
Lee wrote:
Note from Google: The author of this message requested that it not be archived. This
message will be removed from Groups in 4 days (Dec 25, 7:32 pm). Java script Dude said:
If I am missing something maybe you could give some insight on how to
best continue a thread that is closed.

Since when can threads "close"? Is this something that Google does?


This is an interesting question. Especially since you've evidently
requested that your message not be archived. Too bad I'm quoting it in
my reply, huh ;)

After some period of time (on the order of months, I think), Google no
longer permits replies (to usenet) of usenet postings (I filed a bug
report - think it will be fixed?). They do allow replies to the
author. Since google is how I read/post, for me the thread could be
considered closed at that point. Frankly, I don't agree with this
restriction as I use google as a filing cabinet, and it makes sense to
keep related topics together. There are several instances where a
thread is incomplete and I would happily append additional info, but I
cannot. It would be nice if there were a public interface for this
purpose because creating a new thread at that point is splintering,
leading to confusion on later searches.

Csaba Gabor from Vienna

Dec 21 '05 #15
>>> Array objects are not host objects as HTMLDivElement objects are, they
are core objects. Therefore, for Array objects, a simple
if (o instanceof Array)
There are flaws in instanceof operator in JavaScript when referencing
variables in child window. This flaw effects IE and mozilla. I have
tested in both and have concluded it is not stable enough to build good
code on. I would be glad to share a testcase that proves this.
Yes, please, that would turn out to be interesting either way.


Here is the source for the test. Please excuse the raw HTML. I am not
passing this by any w3c acid tests etc.

I am sure that the develpers of IE and Mozilla have a good excuse as to
why it does not work but one must be careful when using instanceof
espcially when managing multiple windows. Frames are a case where one
must be very careful of instanceof.

For instanceof to work properly, it must be compared to the Object in
the window that is being referenced. eg:

if(oChildWin.oObj1 instanceof oChildWin.Object) { ...

This is not intuitive and most developers would stumble on trying to
get it to work with:

if(oChildWin.Obj1 instanceof Object) {...

This will cause some issues with code that could be difficult to nail
down.
<!-- Main Tester File -->
<html>
<head>
<title>instanceof tester</title>
</head>
<body>
<script>
function dw(s){
document.body.innerHTML+=s
}
// Local Test
var json_loc={x:"a",y:"b"}, s_loc="abc"
dw(
"<br>~~ Local Test (Object) ~~"+
"<br> window.json_loc.constructor = "+
window.json_loc.constructor+
"<br> (window.json_loc instanceof Object) = "+
(window.json_loc instanceof Object)
)

// Remote Test
var _childWin=window.open(
"_instof_test_p2.html",
"_blank",
"height=200,width=200"
)
window.focus()
function childWindow_loaded(oChildWin){
dw(
"<br><br>~~ Remote Test (Object) ~~"+
"<br> _childWin.json_rem.constructor = "+
_childWin.json_rem.constructor+
"<br> (_childWin.json_rem instanceof Object) = "+
(_childWin.json_rem instanceof Object)+
"<br> (_childWin.json_rem instanceof oChildWin.Object) = "+
(_childWin.json_rem instanceof oChildWin.Object)
)
}

</script>
</body>
</html>
<!-- End Main File -->
<!-- Child Window -->
<html>
<head>
<title>instanceof tester</title>
</head>
<body>
<script>
var json_rem={x:1,y:2}, s_rem="123"
window.opener.childWindow_loaded(window)
setTimeout("window.close()",2000)
</script>
Opener called<br>window will close in two seconds
</body>
</html>
<!-- End Child Window -->

Dec 21 '05 #16
"Java script Dude" <de********@yahoo.ca> writes:
For instanceof to work properly, it must be compared to the Object in
the window that is being referenced. eg:

if(oChildWin.oObj1 instanceof oChildWin.Object) { ...

This is not intuitive and most developers would stumble on trying to
get it to work with:

if(oChildWin.Obj1 instanceof Object) {...


I agree that it's not intuitive to someone used to, e.g., Java, where
there is usually only one Object. However, anyone fiddling with
classloaders will probably have had similar experiences with the same
class loaded by two different classloaders, which is a pretty good
analogy to the Javascript behavior.

In Java, a class loaded by two different classloaders exists twice,
and is considered different, although very similar, classes. If the
class contains static state, the state will occour twice.

Similar in Javascript. The Object constructor, and more importantly
its prototype property, cannot meaningfully be shared across windows.
Otherwise, an assignment like
Object.prototype.toString = function(){alert("SUCKER!");}
would affect all pages loaded in that browser from that point on.
That is *not* desireable.

However, the definition of the instanceof operator is that it checks
whether the prototype property of the second operand is in the
prototype chain of the first. If different windows' Object.prototype
are different, then you will probably not be an instance of another
window's Object.

So, yes, it's slightly conterintuitive, but it's also pretty much
the only sensible result.

My guess is that most of the confuzion comes from thinking of Object
as a class. It isn't, because there are no classes. It is a container
for the root of all prototype chains for objects created entirely in
the context of the global object where it lives. In Javascript,
inheritance is between objects, not between classes.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Dec 21 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Arjen | last post by:
Hi, I have a class with some attributes. For example class person with name as attribute. I have add multiple persons in an arraylist. Now I need a function to get/find a person by the name...
2
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
10
by: Sacha Korell | last post by:
I'm trying to load a drop-down list with all DropDownList control names from another page. How would I be able to find those DropDownList controls? The FindControl method will only find a...
5
by: Joerg Battermann | last post by:
Hello there, I have a custom type defined via Public Class Requirement Public IDNumber As Integer Public Name As String Public Description As String Public VersionPlanAttributes As New _
4
by: John Wolff | last post by:
Pardon me for such a newbie question. I've only been using C# for 14 months, and most of the stuff has been relatively basic. I have a serializable "Contact" class that has a number of...
7
by: Nemisis | last post by:
Hi everyone, Can anyone tell me if it is possible to pass in a property of an object into a sub, and within that sub, find out the name of the item that was passed along with the property name??...
3
by: =?Utf-8?B?R3JlZyBN?= | last post by:
Hello, I'm running an asp.net, intranet web application using .net framework 1.1 on IIS5.1 / 6.0. Through the web application, I would like to press a button on the web page, have another window...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
10
by: CodeNoob | last post by:
please help been working on a project got it down to 5 errors from 100 now i have no idea what to do. Errors: init: deps-jar: Created dir: C:\Users\Tommy\Desktop\build\classes Compiling 306...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.