[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#16708: marked as done (Difficulties with objects in JavaScript...) by Harri Porten <harri@trollt
From:       owner () bugs ! kde ! org (Stephan Kulow)
Date:       2001-02-28 23:48:04
[Download RAW message or body]

Your message dated Thu, 01 Mar 2001 00:01:48 +0100
with message-id <3A9D835C.24AA7ED2@trolltech.com>
and subject line Difficulties with objects in JavaScript...
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

Received: (at submit) by bugs.kde.org; 8 Dec 2000 09:45:21 +0000
Received: (qmail 21452 invoked from network); 8 Dec 2000 09:45:20 -0000
Received: from unknown (HELO london.exicom.se) (212.209.104.74)
  by max.tat.physik.uni-tuebingen.de with SMTP; 8 Dec 2000 09:45:20 -0000
Received: from london.exicom.se (IDENT:bjorn@london [194.14.196.13])
	by london.exicom.se (8.9.3/8.9.3) with SMTP id LAA21784
	for submit@bugs.kde.org; Fri, 8 Dec 2000 11:45:54 +0100
Date: Fri, 8 Dec 2000 11:45:54 +0100
Message-Id: <200012081045.LAA21784@london.exicom.se>
Subject: Difficulties with objects in JavaScript...
From: Bjorn Westlin <vezzlan@exicom.se>
To: submit@bugs.kde.org

Package: kjs
Version: 3.0 (KDE 2.0.9 >= 20001128)
Severity: normal
Compiler: gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
OS: Linux 2.2.12-20smp i686 (compiled sources)

Hi there.

I have some troubles getting Classes in Javascript to work. The following examples \
works in Internet Explorer, Netscape 4 and 6. However only 2 of the following \
examples works in Konqueror.

// Example 1 ----------------------
<html>
<head>
<script language="JavaScript1.1">
function MyClass() {
  this.test = MyClass_test;
}
function MyClass_test() {
  alert("test");
}
var myObject = new MyClass();
</script>
</head>
<body>
<a href="javascript:myObject.test()">test</a>
</body>
</html>

This example does not work in Konqueror and gives the following error message:
JS: Type error at line 1. Expression is no object.

// Example 2 ----------------------
<html>
<head>
<script language="JavaScript1.1">
function MyClass_test() {
  alert("test");
}
function MyClass() {
}
MyClass.prototype.test = MyClass_test;
var myObject = new MyClass();
</script>
</head>
<body>
<a href="javascript:myObject.test()">test</a>
</body>
</html>

This one works and shows that the prototype object is supported which is a feature \
added in JavaScript 1.1

// Example 3 ----------------------
<html>
<head>
<script language="JavaScript1.1">
function MyClass() {
}
MyClass.prototype.test = function() {
  alert("test");
}
var myObject = new MyClass();
</script>
</head>
<body>
<a href="javascript:myObject.test()">test</a>
</body>
</html>

This doesn't work in Konqueror. The following messages is given:
JavaScript parse error.
JS: Reference error. Can't find variable: myObject
JS: Type error at line 1. Expression is no object.


My problem is that I am trying to get a product I'm working on to work with Konqueror \
and the obove problems hinders me from doing that. However, I don't know if these \
examples is supposed to work, if they colpies with the ecma standard. But it would be \
great if the could be supported. Hopefully this can be solved.

Regards
/ Björn Westlin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic