473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Opera shows up bad code?

Hello,

I have just tried using the latest version of Opera on some code which
works OK with IE, FF and Safari but there is probably a better way of
writing the code.

A sound is played when the play image is clicked and then the user has
the choice of 2 images to answer a question.

The code below deals with the first of the 2 images which can be
clicked to answer the question. The other function is similar.
function checkThisFirst(what) {

var x = what.id;
var first_part_id = x.substring(0,2);
result[count] = "first";
document.getElementById('test'+count).className = 'hiddenDiv2';
// line above - play image made invisible
document.getElementById('test'+count+'1').classNam e = 'hiddenDiv2';
// line above - the first and second images made invisible
if (count<4) {
document.getElementById('test'+(count+1)).classNam e = 'visibleDiv2';
/ /line above - the next play button made visible
}

}

There are 4 sounds to be played so I need to get

result[1] to result[4]

Opera shows up the problem (?) in that the title Test 4 does not
become invisible after the 4th choice has been made as do Tests 1 to
Test 3 titles. With IE, FF and Safari Test 4 does become invisible.

Better way of dealing with the count equals 4 situation?

Thanks

Geoff

PS I hope I have made this clear - if not will post more of the code.
Jun 27 '08 #1
4 2067
In comp.lang.javascript message <s17224hqkoedj183sumpubol27398hsnrj@4ax.
com>, Wed, 7 May 2008 04:21:04, Geoff Cox <gc**@freeuk.notcomposted:
>
I have just tried using the latest version of Opera on some code which
works OK with IE, FF and Safari but there is probably a better way of
writing the code.
Latest? Does that mean Version 9.27, or Mini 4, or Opera Mobile, or
some beta version? I see 9.5 beta is available.

What does (in 9.27; maybe similar in 9.5) Tools Advanced, Error Console
show?

Safari is now 3.1.1.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zipTimo Salmi's Turbo Pascal FAQ.
Jun 27 '08 #2
On Wed, 7 May 2008 19:05:28 +0100, Dr J R Stockton
<jr*@merlyn.demon.co.ukwrote:
>In comp.lang.javascript message <s17224hqkoedj183sumpubol27398hsnrj@4ax.
com>, Wed, 7 May 2008 04:21:04, Geoff Cox <gc**@freeuk.notcomposted:
>>
I have just tried using the latest version of Opera on some code which
works OK with IE, FF and Safari but there is probably a better way of
writing the code.

Latest? Does that mean Version 9.27, or Mini 4, or Opera Mobile, or
some beta version? I see 9.5 beta is available.

What does (in 9.27; maybe similar in 9.5) Tools Advanced, Error Console
show?

Safari is now 3.1.1.
Thanks for your reply John,

It is Opera on my PC, is version 9.27 build 8841.

I was wrong in saying that the last Title doesn't become invisible, it
does but is very slow to do so. Also the images may take 3-4 seconds
to come up and some times when I click on them it takes 3-4 seconds
for the onClick to happen.

The error console shows the following - any idea how I check on

"message: Security error: attempted to read protected variable" or any
other thoughts?

Cheers

Geoff
JavaScript - http://www.site.com/files/group1/group1-lab1.htm
Unknown thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable
CSS - http://www.site.com/files/group1/group1-lab2.htm
Inlined stylesheet
-khtml-opacity is an unknown property
Line 6:
-khtml-opacity: 0.40;
----------------^
CSS - http://www.site.com/files/group1/group1-lab2.htm
Inlined stylesheet
-moz-opacity is an unknown property
Line 7:
-moz-opacity: 0.40;
--------------------------^
JavaScript - http://www.site.com/files/group1/group1-lab2.htm
Unknown thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable
JavaScript - http://www.site.com/files/group1/group1-lab3.htm
Unknown thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable

Jun 27 '08 #3
On Wed, 7 May 2008 19:05:28 +0100, Dr J R Stockton
<jr*@merlyn.demon.co.ukwrote:

John,

I have just read elsewhere that getting data from a foreign domain is
a security violation for Javascript - this true? If so then I may have
a problem as the audio files come form another server - the idea being
that this would be more robust in the event of losts of users
accessing the site at the same time.

Could the foreign domain (www.site.com) explain this Opera error
message?

JavaScript - http://www.site.com/files/group1/group1-lab2.htm
Unknown thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable
JavaScript - http://www.site.com/files/group1/group1-lab3.htm
Unknown thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable

Any way round this?

Cheers

Geoff
Jun 27 '08 #4
On Wed, 7 May 2008 19:05:28 +0100, Dr J R Stockton
<jr*@merlyn.demon.co.ukwrote:

John,

I have changed so that the audio files are now taken from the same
server as the rest of the pages but get an error message with Opera

JavaScript - http://www.mysite.com/files/group1-lab3.htm
Unknown thread
Error:
name: ReferenceError
message: Security error: attempted to read protected variable

The images are slow to respond to onClick event.

Any thought on how I investigate this?!

Cheers

Geoff
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Spijon | last post by:
Seems opera can not work normally with javascript, does anyone knows how to fix it? Thanks in advance.
6
by: Shaun Fleming | last post by:
I've been trying to make this simple script compatible across various browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I have version 7.11). This is what is supposed to happen:...
5
by: Randall Parker | last post by:
I am trying to take some very MS-specific HMTL and make it work in Mozilla and Opera. I see that there is a character that shows as a right arrow in IE that shows as an R in a circle in Moz and...
36
by: Peter Brause | last post by:
Hello, my stylesheet shows different colors for visited, active and hovered links. It works fine in IE 6, but in Opera 7 the color for the active link (red background) is never shown. How to...
17
by: windandwaves | last post by:
Hi Folk I recently completed an interactive map. I have now discovered that it is not working in Opera. The address is: http://switch.hosts.net.nz/~admin64/search.php The map is...
7
by: Sander Tekelenburg | last post by:
See <http://santek.no-ip.org/~st/tests/CSS/Opera/align.php>. Would appreciate confirmation that this is a bug in Opera, not my mistake. -- Sander Tekelenburg,...
3
by: Paul Gorodyansky | last post by:
Hi, I have function that works via onkeypressed - for example, what to catch when a user presses a punctuation symbol such as '.' So I check keyCode for that - works just fine in Opera 8,...
5
by: Dr J R Stockton | last post by:
Computed at <URL:http://www.merlyn.demon.co.uk/js-datex.htm#OSTby the code shown above it when using Opera 9.24 : Test exact dates in two 11-year ranges; IE & FF are OK. Opera 9.24 shows...
15
by: dhtml | last post by:
Title says it. If I use a for in loop on an HTML collection, I get length twice. <!DOCTYPE HTML> <html lang="en"> <head> <title>length twice</title> </head> <body> <form...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.