473,614 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEle mentById('test' +count).classNa me = 'hiddenDiv2';
// line above - play image made invisible
document.getEle mentById('test' +count+'1').cla ssName = 'hiddenDiv2';
// line above - the first and second images made invisible
if (count<4) {
document.getEle mentById('test' +(count+1)).cla ssName = '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 2108
In comp.lang.javas cript message <s17224hqkoedj1 83sumpubol27398 hsnrj@4ax.
com>, Wed, 7 May 2008 04:21:04, Geoff Cox <gc**@freeuk.no tcomposted:
>
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.demo n.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demo n.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.dem on.co.ukwrote:
>In comp.lang.javas cript message <s17224hqkoedj1 83sumpubol27398 hsnrj@4ax.
com>, Wed, 7 May 2008 04:21:04, Geoff Cox <gc**@freeuk.no tcomposted:
>>
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.dem on.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.dem on.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
2331
by: Spijon | last post by:
Seems opera can not work normally with javascript, does anyone knows how to fix it? Thanks in advance.
6
2714
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: when the user clicks a button in the main window, a dialog window pops up. In the dialog the user enters a university to search for. When the string is submitted, the dialog then shows all the matches found in the database. The user picks one and...
5
8024
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 Opera. Here's excerpt that generates the right arrow in IE. <span style='font-size:small;font-family:Symbol;mso-ascii-font-family:"Verdana"; mso-hansi-font-family:"Verdana";mso-char-type:symbol;mso-symbol-font-family: Symbol'><span...
36
3867
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 explain this? Here is my code: (code optimization will be done later) 1. The HTML file <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>
17
1658
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 basically 20+ images over each other, each of which are transparent gifs.
7
1769
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, <http://www.euronet.nl/%7Etekelenb/>
3
5139
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, Mozilla/Firefox, IE
5
1315
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 errors near most/all EU Summer Time steps outside 1970-2037. 1966-03-27 - Sat, 26 Mar 1966 23:00:00 GMT+0000 1966-10-28 - Thu, 27 Oct 1966 23:00:00 GMT+0000
15
2006
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 action="javascript:;" id="form1">
0
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8287
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.