Bug 124979 - [test-case] Konqueror does not interpret onClick=document.images["imgname"].src="filename.jpg" correctly
Summary: [test-case] Konqueror does not interpret onClick=document.images["imgname"].s...
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-05 15:23 UTC by Pavel Alexeev
Modified: 2008-01-24 18:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Alexeev 2006-04-05 15:23:09 UTC
Version:           3.5.2 (using KDE KDE 3.5.2)
Installed from:    Slackware Packages
Compiler:          gcc 3.4.6 installed (slackware-current), but i don't know with which version is compiled KDE by Pat 
OS:                Linux

The simple HTML/JavaScript code:

<html>
 <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>
 <td><img src="2.jpg" name=img1 width="48" onClick="document.images['main_img'].src='2.jpg'"></td>
 </tr>
 </table>
 </body>
</html>

is working in IE and Firefox, but does not work in Konqueror. The idea is: by clicking one of two small images at bottom, the upper image must be reloaded with the appropriate jpg-file. It does not work in konqueror but works in IE, Firefox, Mozilla.

I tried to replace "document.images['main_img']" with "getElementById['main_img']", "name" with "id" etc., but this does not work too.
Comment 1 Pavel Alexeev 2006-04-05 16:04:25 UTC
Additional information:
The code IS WORKING if the jpg-files are in / (root) directory and onClick="document.images['main_img'].src='/2.jpg'" (so, with "/").
Comment 2 Pavel Alexeev 2006-04-05 16:25:10 UTC
The following are working too:
onClick="document.images['main_img'].src='img/2.jpg'" (jpg-files in subdirectory)
onClick="document.images['main_img'].src='http://img.lenta.ru/news/2006/04/05/lime/picture.jpg'" (absolute URL)
NOT working:
1) absolute local path:
onClick="document.images['main_img'].src='/tmp/2.jpg'"
2) jpg-files in the same directory:
onClick="document.images['main_img'].src='2.jpg'"
onClick="document.images['main_img'].src='../tmp/2.jpg'"

The standalone statement 
<script>document.main_img.src="2.jpg";</script>
is however working!
Comment 3 Pavel Alexeev 2006-04-05 17:26:42 UTC
The following code works:
onClick="
document.images['main_img'].src='02.jpg';document.images['main_img'].height=docu
ment.images['main_img'].height-1;document.images['main_img'].height=document.ima
ges['main_img'].height+1;"
but it is not a good solution. The bug should be fixed anyway.
Comment 4 Martin Fitzpatrick 2007-01-09 00:33:04 UTC
Unable to reproduce any of the failing behaviour on KDE 3.5.5 / Kubuntu 6.10.

Testcase available online at http://www.mutube.com/x/kde/bug124979/index.html for both issue 1 & 2 mentioned in Comment #2. Also tested this locally again with no problems.. Can anyone reproduce this bug?
Comment 5 Philip Rodrigues 2007-01-09 10:07:05 UTC
I see "tick cross > tick" for the 3 cases in the test case. Is that right?
Comment 6 Tommi Tervo 2007-01-09 10:57:49 UTC
When clicking cross the right tick should change to cross and vice versa. And it does.
Tested with 3.3.2a and svn r620k.
Comment 7 Maksim Orlovich 2008-01-24 18:10:55 UTC
WFM too..