473,748 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opera <NOSCRIPT> will be executed...Flas h detection

Hello,
there is a known problem with Opera and the execution of content shown
in <NOSCRIPT> tag.

Everythings works fine, if there is only one simple script like:
http://www.dr-wald.de/test/Opera-NOSCRIPT.html

Switching off Javascript will show the alternative content. Javascript
enabled will only show the JS-content, _not_ the <NOSCRIPT> content.

But:
If there are some more scripts in a page, JS content _and_ alternative
<NOSCRIPT> content is shown, if there seems to be a script error or an
unknown script before executing the error script. This behavior is
according to the W3C, but IMHO not useful:
http://www.w3.org/TR/1998/REC-html40....html#h-18.3.1

I am developing a Flash browser detection working also with Opera, not
only Moz/IE: There shall be displayed an alternative content, if flash
is not supported or if flash version is to low.
Macromedia is providing a browser detection script, which works fine
with Opera, if _any_ flash version is installed.

But:
If _NO_ flash is installed (rename
c:\Programme\Op era72\Program\P lugins\NPSWF32. dll) javascript content
_and_ alternative <NOSCRIPT> content will be shown:
http://www.dr-wald.de/test/mainframetest.html

I do not know how to solve this problem!

There must be a problem with the following code:
<script type="text/javascript">
<!--
var contentVersion = 5;
var plugin = (navigator.mime Types &&
navigator.mimeT ypes["applicatio n/x-shockwave-flash"]) ?
navigator.mimeT ypes["applicatio n/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugi ns["Shockwave Flash"].description.sp lit(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt (words[i])))
continue;
var PluginVersion = words[i];
}
var FlashCanPlay = PluginVersion >= contentVersion;
}
else if (navigator.user Agent && navigator.userA gent.indexOf("M SIE")>=0
&& (navigator.appV ersion.indexOf( "Win") != -1)) {
[...]
Please, are there any hints?
X-Post2 comp.lang.javas cript,opera.pag e-authoring
Fup2 comp.lang.javas cript

--
Best regards/ MfG,
Gustav Medler
pm.gustav.medle r (at) gmx.net
*Mail reply will not be read,
*please use address above!
Jul 20 '05 #1
6 4773
On Thu, 6 Nov 2003 08:52:46 +0100, "Gustav Medler"
<no*******@nurf uerspam.de> wrote:
there is a known problem with Opera and the execution of content shown
in <NOSCRIPT> tag.
No, as you suggest later, there's a known problem with the other UA's
and the HTML specification.
I do not know how to solve this problem!
NOSCRIPT is generally useless for the above reasons, avoid it, use
more appropriate methods to degrade (e.g. only have javascript write
content you're unsure about, use pure HTML approaches to degrading
flash - don't use flash...)
var plugin = (navigator.mime Types &&
This needs to check for a navigator object.
else if (navigator.user Agent && navigator.userA gent.indexOf("M SIE")>=0


This is flawed...

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2
Jim Ley <ji*@jibbering. com> wrote/schrieb:
var plugin = (navigator.mime Types &&

This needs to check for a navigator object.
else if (navigator.user Agent &&
navigator.userA gent.indexOf("M SIE")>=0

This is flawed...


I do know the problems about the UA's espacially from Opera. In my
opinion a good resolution is not to detect the UA's but using
(!window.opera) or (window.opera). This is IMHO displayed every
time.....

But this issue doe not solve my problem described above.
--
Best regards/ MfG,
Gustav Medler
pm.gustav.medle r (at) gmx.net
*Mail reply will not be read,
*please use address above!
Jul 20 '05 #3
On Thu, 6 Nov 2003 12:21:29 +0100, "Gustav Medler"
<no*******@nurf uerspam.de> wrote:
But this issue doe not solve my problem described above.


Yes, I addressed that in my other points - don't use NOSCRIPT, it's
flawed, using OBJECT or similar to just display the flash with
appropriate degrading, or only add the flash if you've successfully
detected that it's supported, and you can replace the fallback
content.

I don't really understand your actual problem - what are you putting
in NOSCRIPT that's so disastrous that it's displayed aswell as the
flash? if it's "install flash" then you're just misusing
web-authoring, your page should degrade.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #4
Jim Ley <ji*@jibbering. com> wrote/schrieb:
Yes, I addressed that in my other points - don't use NOSCRIPT, it's
flawed, using OBJECT or similar to just display the flash with
appropriate degrading, or only add the flash if you've successfully
detected that it's supported, and you can replace the fallback
content.
That's it want I want to do in Javascript ;-)
But Opera seems to be a little bit particular especially if _no_ flash
plugin is installed. All tested cases are working under all
circumstances, NS4.7, Moz, Konqueror, IE. Only Opera shows the problem
of displaying script _and_ noscript content simultaneously.
I don't really understand your actual problem - what are you putting
in NOSCRIPT that's so disastrous that it's displayed aswell as the
flash? if it's "install flash" then you're just misusing
web-authoring, your page should degrade.


On the one hand the NOSCRIPT content shall be a static picture of the
animated content. I will not ask a visitor to install or update the
flash plugin, because in my opinion it will be boring for them.
On the second hand there are some layout problems if _no_ content is
displayed.

How to change this script for detecting that no plugin is installed in
an Opera browser?
[Example page at: http://www.dr-wald.de/test/mainframetest.html ]
<script type="text/javascript">
<!--
var contentVersion = 5;
var plugin = (navigator.mime Types &&
navigator.mimeT ypes["applicatio n/x-shockwave-flash"]) ?
navigator.mimeT ypes["applicatio n/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugi ns["Shockwave Flash"].description.sp lit(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt (words[i])))
continue;
var PluginVersion = words[i];
}
var FlashCanPlay = PluginVersion >= contentVersion;
}
else if (navigator.user Agent && navigator.userA gent.indexOf("M SIE")>=0
&& (navigator.appV ersion.indexOf( "Win") != -1)) {
[...]
--
Best regards/ MfG,
Gustav Medler
pm.gustav.medle r (at) gmx.net
*Mail reply will not be read,
*please use address above!
Jul 20 '05 #5
On Thu, 6 Nov 2003 16:17:25 +0100, "Gustav Medler"
<no*******@nurf uerspam.de> wrote:
On the one hand the NOSCRIPT content shall be a static picture of the
animated content. I will not ask a visitor to install or update the
flash plugin, because in my opinion it will be boring for them.
Great, so use your script, detect flash, if it's found replace the
fallback image in the page with the flash, no need to do anything in
the situation where flash isn't detected, you just leave the document
as is, same as when script is disabled.
else if (navigator.user Agent && navigator.userA gent.indexOf("M SIE")>=0
&& (navigator.appV ersion.indexOf( "Win") != -1)) {


As I noted before, this script is flawed, your problem is a lot more
than opera with this approach.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #6
Jim Ley <ji*@jibbering. com> wrote/schrieb:
Great, so use your script, detect flash, if it's found replace the
fallback image in the page with the flash, no need to do anything in
the situation where flash isn't detected, you just leave the document
as is, same as when script is disabled.


Resolution found!

Problem:
JS-Browser detection works fine if any version of flash plugin
(vers.2-7) is installed. If there is _NO_ flash plugin installed, SCRIPT
and NOSCRIPT content will be executed by Opera, pictures for example
will be shown twice.
This behavior is according to W3C because Opera does not know the
'SCRIPT LANGUAGE=VBScri pt' and will trade it as a script error with
execution of the NOSCRIPT content.
http://www.w3.org/TR/1998/REC-html40....html#h-18.3.1

Resolution:
This behaviour can be solved simply by adding 'window.opera &&' to this
line of the detection script:

else if (navigator.user Agent && navigator.userA gent.indexOf("M SIE")>=0
&& (navigator.appV ersion.indexOf( "Win") != -1)) {

Better version:

else if (!window.opera && navigator.userA gent &&
navigator.userA gent.indexOf("M SIE")>=0 &&
(navigator.appV ersion.indexOf( "Win") != -1)) {

Browser detection in Opera is difficult because of spoofing, but IMHO
'Opera' will always be shown.....

The whole flash detection script works now including display of alternative
content
for 'too low flash version',
for 'no flash plugin detected/installed' and
for 'javascript disabled'
in NS4.7+, IE 5+, Opera5+, Moz1+, Konqueror3+ on Win32/Linux.

[Somebody surfing with MAC???]

Whole detection script:

<!-- Start Flash -->
<script type="text/javascript">
<!--
var contentVersion = 5;
var plugin = (navigator.mime Types &&
navigator.mimeT ypes["applicatio n/x-shockwave-flash"]) ?
navigator.mimeT ypes["applicatio n/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugi ns["Shockwave Flash"].description.sp lit(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt (words[i])))
continue;
var PluginVersion = words[i];
}
var FlashCanPlay = PluginVersion >= contentVersion;
}
else if (!window.opera && navigator.userA gent &&
navigator.userA gent.indexOf("M SIE")>=0 &&
(navigator.appV ersion.indexOf( "Win") != -1)) {
document.write( '<SCR' + 'IPT LANGUAGE=VBScri pt\> \n');
document.write( 'on error resume next \n');
document.write( 'FlashCanPlay = (
IsObject(Create Object("Shockwa veFlash.Shockwa veFlash." &
contentVersion) ))\n');
document.write( '</SCR' + 'IPT\> \n');
}
if ( FlashCanPlay ) {
document.write( '<OBJECT
classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflas
h.cab#version=6 ,0,0,0" ID="schloss_gr " WIDTH="365" HEIGHT="265">') ;
document.write( '<PARAM NAME="movie" VALUE="schloss_ gr.swf"><PARAM
NAME="quality" VALUE="high"><P ARAM NAME="scale" VALUE="exactfit "><PARAM
NAME="bgcolor" VALUE="#E2E2E2" >');
document.write( '<EMBED src="schloss_gr .swf" quality="high"
scale="exactfit " bgcolor="#E2E2E 2" swLiveConnect=F ALSE WIDTH="365"
HEIGHT="265" NAME="schloss_g r" TYPE="applicati on/x-shockwave-flash"
PLUGINSPAGE="ht tp://www.macromedia. com/go/getflashplayer" >');
document.write( '</EMBED>');
document.write( '</OBJECT>');
} else{
document.write( '<a href="../start/index.html" target="_parent "><img
src="../index/schloss_gr.jpg" width="365" height="245" border="0"
alt="Praxis"></a>');}
//--></script>

<noscript>
<a href="../start/index.html" target="_parent "><img
src="../index/schloss_gr.jpg" width="365" height="245" border="0"
alt="Praxis"></a>
</noscript>
<!-- End Flash -->
--
Best regards/ MfG,
Gustav Medler
pm.gustav.medle r (at) gmx.net
*Mail reply will not be read,
*please use address above!
Jul 20 '05 #7

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

Similar topics

2
2874
by: llaxman | last post by:
Hello everyone, I was wondering if anyone can help me? I am having some problems wit the <noscript> tag. I actually use it to block banner advertisements from being displaye in my website. I have used it at the <body> tag section and look something like this: <noscript>
12
21771
by: Burton Figg | last post by:
My homepage, www.jimpix.co.uk uses transitional XHTML. The whole thing validates except one line: <noscript><img height="1" width="1" alt="" src="http://u0.extreme-dm.com/0.gif?tag=riggott&amp;j=n" /></noscript> I get this error on this page: http://validator.w3.org/check?uri=http://www.jimpix.co.uk
13
10695
by: Paul | last post by:
Hello: I read the FAQ about embedding HTML code in a Javascript. I have used the "<\/tag>" format to get around validator problems. Now the <NOSCRIPT> block is failing with error #65: 1. Line 52, column 9: document type does not allow element "NOSCRIPT" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag <NOSCRIPT>
7
2350
by: Spartanicus | last post by:
Afaik the use of a <noscriptelement is frowned upon nowadays. For a JS random image changer I tried to use a replacement by having the script change the HTML src attribute value of an img element. The trouble is that in some situations like over slow connections (on initial load when the JS is in an external file), or with a slow client the image specified in the HTML starts to load and display before it's changed by the script. This I'm...
2
2878
by: pow1983 | last post by:
Hi, Is there a tag or script or something I can use to automatically forward people to a HTML page if they dont have flash installed or disabled by their company. Many Thanks, Rich
1
2486
by: Gretsch | last post by:
I have a lot of nicely formatted HTML to be displayed for visitors WITHOUT script (/enabled), and a second set of HTML for those WITH script. The <noscript> tag allows me to separate the HTML for those without script, How can I separate the HTML for those with script? (ie not run for those without script enabled. The only way I've found so far is: ... <noscript> This should only be diplayed when scripting is not configured
28
2491
by: FreeCopywritingTips | last post by:
Does anyone know how to get around the </noscriptissue, were my HTML editor refuses to save this tag?
4
3974
by: phpmel | last post by:
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script language="JavaScript" type="text/javascript"> </script> <noscript> <b>Please</b> Try this page for browsers that can not handle SCRIPTing. <a href="EnableJavascript.aspx">click here</a> </noscript>
0
8831
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
9555
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
8247
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
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
6076
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();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
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.