Bug 30396

Summary: konqueror: incorrectly ignores javascript inside HTML comments <!--- -->
Product: [Applications] konqueror Reporter: ivan-kde
Component: kjsAssignee: Konqueror Developers <konq-bugs>
Status: CLOSED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description ivan-kde 2001-08-08 07:53:19 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kjs
Version:           KDE 2.1.2 
Severity:          normal
Installed from:    Debian Packages
Compiler:          gcc version 2.95.4 20010721 (Debian prerelease)
OS:                Linux
OS/Compiler notes: Not Specified

Konqueror incorrectly ignores javascript inside HTML comments.

For example:

<SCRIPT><!---
function svcdb_change (svcdb) {
  alert("rawr!!!");
}
--></SCRIPT>

does not work but:

<SCRIPT>
function svcdb_change (svcdb) {
  alert("rawr!!!");
}
</SCRIPT>

works fine.

The first snippet above works in IE Netscape and Mozilla.  Since enclosing
JavaScript in HTML comment tags is very common and suggested by many
tutorials/books/etc (to "hide the script from old browsers") I suggest that
Konqueror should ignore HTML comments inside <SCRIPT> tags.

If you need any additional information please don't hesitate to contact me.

For cross-reference this is debian
bug #100386



(Submitted via bugs.kde.org)
Comment 1 Harri Porten 2001-08-09 19:53:04 UTC
> Konqueror incorrectly ignores javascript inside HTML comments.
> 
> For example:
> 
> <SCRIPT><!---
> function svcdb_change (svcdb) {
>   alert("rawr!!!");
> }
> --></SCRIPT>

Works fine with KDE 2.2.

Harri.