473,386 Members | 1,973 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,386 software developers and data experts.

prototype prob

I have set up a 'class' using the prototype prop.

I pass the constructor a html tag children object and set 'this.obj = obj'.
When calling the first method of the class using the object it works fine.
However, when calling any second method using the object i get an error.
When debugging(alerting) I am told that in the second method 'this.obj' is
undefined.
I have tried changing the class to call different methods first, and the
result is the same:
first methodcall works fine, later calls to other class methods result in
errors.

It seems the first 'this.obj' instance is acceptable, later ones are not...

I dont get it...

Any ideas ?

--
http://home.online.no/~oeyvtoft/ToftWeb/


Jul 23 '05 #1
4 983
On Sat, 28 Aug 2004 02:05:00 +0200, oeyvind toft wrote:
Any ideas ?


Supply URL.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
Sorry, not out there yet...
Its a big ugly script in the making...

Oeyvind

--
http://home.online.no/~oeyvtoft/ToftWeb/

"Andrew Thompson" <Se********@www.invalid> skrev i melding
news:r0****************************@40tude.net...
On Sat, 28 Aug 2004 02:05:00 +0200, oeyvind toft wrote:
Any ideas ?


Supply URL.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

Jul 23 '05 #3
On Sat, 28 Aug 2004 02:20:35 +0200, oeyvind toft <oe******@online.no>
wrote:

[Top-post fixed]
"Andrew Thompson" <Se********@www.invalid> skrev i melding
news:r0****************************@40tude.net...
Supply URL.


Sorry, not out there yet...
Its a big ugly script in the making...


Well, at least provide us with the (relevant) code you do have. We can
hardly tell what's wrong without seeing it!

Mike
Please do not top-post. Responses should go underneath what you are
responding to, and irrelevant text should be snipped.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4
Hi again

I`ve found the problem. I had some errors in some dynamic code elements so
that
class methods called 'afunction' instead of 'this.afunction'. Thats why the
'this.obj' wasnt
recognized.

Oeyvind

--
http://home.online.no/~oeyvtoft/ToftWeb/

"Michael Winter" <M.******@blueyonder.co.invalid> skrev i melding
news:opsde3e4r2x13kvk@atlantis...
On Sat, 28 Aug 2004 02:20:35 +0200, oeyvind toft <oe******@online.no>
wrote:

[Top-post fixed]
"Andrew Thompson" <Se********@www.invalid> skrev i melding
news:r0****************************@40tude.net...
Supply URL.


Sorry, not out there yet...
Its a big ugly script in the making...


Well, at least provide us with the (relevant) code you do have. We can
hardly tell what's wrong without seeing it!

Mike
Please do not top-post. Responses should go underneath what you are
responding to, and irrelevant text should be snipped.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

Jul 23 '05 #5

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

Similar topics

8
by: Elf M. Sternberg | last post by:
One of the complaints about prototype.js (google for it if you're not familiar with it) is that it's poorly documented. I have this inkling that the key to understanding prototype.js is in the...
8
by: Robert | last post by:
Hi, I can use "with" like this: function MyObject(message) { this.message = message; } function _MyObject_speak() {
2
by: stephane | last post by:
Hi all, What I am trying to achieve is an 'inherits' method similar to Douglas Crockford's (http://www.crockford.com/javascript/inheritance.html) but that can enable access to the superclass'...
4
by: lkrubner | last post by:
I'm reading an essay, I think one of Crockford's, and it has this example in it: function Demo() { } Demo.prototype = new Ancestor(); Demo.prototype.foo = function () { } ; Does Ancestor now...
21
by: Rob Somers | last post by:
Hey people, I read a good thread on here regarding the reason why we use function prototypes, and it answered most of my questions, but I wanted to double check on a couple of things, as I am...
6
by: mmcloughlin | last post by:
I'm learning about objects and am trying to figure out how basic inheritance works. I've got into the habit of explicitly setting the prototype object with an object literal as it seems to make the...
5
by: Daz | last post by:
Hi everyone. My query is very straight forward (I think). What's the difference between someFunc.blah = function(){ ; } and
6
by: burningodzilla | last post by:
Hi all - I'm preparing to dive in to more complex application development using javascript, and among other things, I'm having a hard time wrapping my head around an issues regarding "inheritance"...
3
by: jacobstr | last post by:
I've noticed Object.extend used in a few different ways and I'm having trouble distinguishing why certain usages apply to a given situation. On line 804 Ajax.Base is defined as follows: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.