Skip navigation.

exploreopera

| Help

Sign up | Help

When it's broken, it's broken

,

Since I spend most of my day investigating problems with Opera, I'm sometimes too quick to take for granted that a problem is Opera's problem. So when I was exploring the JIRA site with an internal build of Opera, clicked a link saying JIRA video overview and saw nothing but an empty page and a very weird JS console error, I immediately started reducing the page to a small test case to file a bug report.

The error was completely incomprehensible, except that it seemed like Opera tried to execute some HTML markup as JavaScript:
Inline script compilation
Syntax error while loading: line 6 of inline script at http://www.atlassian.com/software/jira/videos/jira_video/jira_video.jsp :
Expected expression
<script language="JavaScript"></script><noscript></noscript><!--/DO NOT REMOVE/-->
--------------------------------------^


This sometimes happens if a file has a SCRIPT element with a SRC that links to a HTML file. But the page had only two external .js files, and neither was broken.

After a bit of trial and error I had a minimal file. The error occurs because a starting HTML comment inside a SCRIPT tag does not have a matching closing comment inside that SCRIPT tag. So Opera looks ahead for another closing comment, and it seems this confusion means some of the markup is seen as being "inside" the script.

Now I was in for a great surprise: both IE7 and Firefox 2 did exactly what Opera did when displaying my attempted test case! Have a look:
jira.htm
My first thought was that while minimising I had removed something that made the site work in IE and Firefox. Then I tried watching the video in either browser.. No joy. JIRA's video page is broken (by an Omniture SiteCatalyst script that carelessly omits a //--> from a script element) and - wow - they have broken it in a cross-browser compatible way!

Well, I just added that missing closing comment and re-loaded the page from cache in Opera - but I must be the only person who has seen JIRA's demo video recently :smile:

X-UA-IncompatibleMicrosoft listens

Comments

avatar
I hope you added the comment before the "DO NOT ALTER ANYTHING BELOW THIS LINE !" line.

By dantesoft, # 28. February 2008, 11:15:18

avatar
And whtas the use of an empty noscript tag?

By deadHarlequin, # 28. February 2008, 15:21:53

avatar
JIRA video overview loads fine here. Ubuntu 8.04 x64 and Opera 9.5.1823 x64.

Was that the actual page containing the error?

By kyleabaker, # 28. February 2008, 21:12:45

avatar
Yes, it was. Site fixed it. Wow, I wish the response to our Open The Web efforts always was this quick - David must be jealous :-)

By hallvors, # 28. February 2008, 23:33:34

avatar
I found this error in your reduced code pretty quickly. The need to use html comments inside of javascript has faded over the past half a decade or more. Don't most current browsers understand javascript tags correctly now?

By IceArdor, # 1. March 2008, 23:36:58

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.