You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

yozh

Beginner

  • "yozh" started this thread

Posts: 2

Location: Russia

  • Send private message

1

Wednesday, April 5th 2006, 12:24pm

Konqueror does not undestand this simple html. Why?

Source code

1
2
3
4
5
6
7
8
9
10
11
<html><head></head>
<body>
<p align=center><img src="1.jpg" name="main_img" height="480"></p>
<table>
<tr>
<td><img src="1.jpg" name=img0 width="48" onClick=document.images["main_img"].src="1.jpg"></td>
t;
<td><img src="2.jpg" name=img1 width="48" onClick=document.images["main_img"].src="2.jpg"></td>
</tr>
</table>
</body></html>

Save the code as index.html, place two jpg files (1.jpg and 2.jpg) in the same directory, open html-file with IE/Mozilla/Firefox and click on the small images at bottom. The upper image will be replaced with the clicked image. Now, try it with Konqueror :(
Is the code wrong? How should i impove it?

yozh

Beginner

  • "yozh" started this thread

Posts: 2

Location: Russia

  • Send private message

2

Wednesday, April 5th 2006, 5:12pm

RE: Konqueror does not undestand this simple html. Why?

It's a bug possibly, see http://bugs.kde.org/show_bug.cgi?id=124979 . The topic can be closed.

kae

Beginner

Posts: 2

Location: Ireland

Occupation: web developer

  • Send private message

3

Thursday, April 6th 2006, 6:56pm

it's possibly the javascript. I haven't tried it, but this should be more cross-browser:

Source code

1
2
3
4
5
6
7
8
9
10
<html><head></head>
<body>
<p style="text-align:center"><img src="1.jpg" id="main_img" height="480" /></p>
<table>
<tr>
<td><img src="1.jpg" name="img0" width="48" onclick="document.getElementById('main_img').src='1.jpg';" /></td>
<td><img src="2.jpg" name="img1" width="48" onclick="document.getElementById('main_img').src='2.jpg';" /></td>
</tr>
</table>
</body></html>


note that I've used DOM scripting instead of the older arrays-based coding. also, all parameters are quoted (required by recent HTML specs).
kae verens
php ajax programmer
http://verens.com/, http://webworks.ie/