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(alert ing) 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/ 4 995
On Sat, 28 Aug 2004 02:20:35 +0200, oeyvind toft <oe******@onlin e.no>
wrote:
[Top-post fixed] "Andrew Thompson" <Se********@www .invalid> skrev i melding news:r0******** *************** *****@40tude.ne t...
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.
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.******@bluey onder.co.invali d> skrev i melding
news:opsde3e4r2 x13kvk@atlantis ... On Sat, 28 Aug 2004 02:20:35 +0200, oeyvind toft <oe******@onlin e.no> wrote:
[Top-post fixed]
"Andrew Thompson" <Se********@www .invalid> skrev i melding news:r0******** *************** *****@40tude.ne t...
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 bind function.
The problem with Javascript is that the "this" operator is poorly
overloaded and it is often hard to understand in the context of
object-oriented javascript
So, let's start with the definition:
|
by: Robert |
last post by:
Hi,
I can use "with" like this:
function MyObject(message)
{
this.message = message;
}
function _MyObject_speak()
{
|
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' priviledged methods also. Do
you know if this is possible ?
In the following example, I create an ObjectA (variable a), an ObjectB
which inherits ObjectA (variable b) and an ObjectC which inherits
ObjectA (variable c1). The 'toString ()' method...
|
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 have a function called foo?
What if I have 5 different objects, all descended from Ancestor? Do
|
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 writing something up on
functions, and I don't like writing about things I am not sure about.
Ok, then, here we go:
I initially thought that one would only really need to use a function
| |
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
creation of a class easier to read/understand.
Anyway it seems to break the inheritance chain in the following code
and I don't know why.
window.onload = function() {
|
by: Daz |
last post by:
Hi everyone.
My query is very straight forward (I think).
What's the difference between
someFunc.blah = function(){ ; }
and
|
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" using
the prototype property. I realize there are no classes in JS, that code
therefore lives in objects instead of class definitions, and that
"inheritance" must be achieved prototypically and not classically.
That said, on with the code. Say I...
|
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:
Ajax.Base = function() {};
Ajax.Base.prototype = {
setOptions: function(options) { <...>
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |