Avatar billede zux Nybegynder
20. februar 2000 - 15:20 Der er 7 kommentarer og
2 løsninger

Flash or not

eY

Is it possible to create a script who will send people with Flash Plugin to flash/index.html - and people without Flash to html/index.html? I DON'T want to buttons saying Flash or HTML, since I know that 90% will chose html then. And the flash page is off course better!
Avatar billede stroehm Nybegynder
20. februar 2000 - 16:52 #1
Ja :
<script language="Javascript">   
<!--
var flashDetected = false;
if ( navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin && navigator.plugins && navigator.plugins["Shockwave Flash"] ){
    flashDetected = true;
}
//-->   
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
on error resume next
if (flashDetected = false) then
    var FlashMode
    FlashMode = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))
    If (FlashMode = false) then
        FlashMode = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))
    end if
    if (FlashMode = true) then
        flashDetected = true
    end if
end if   
</SCRIPT>
</head>
<SCRIPT LANGUAGE="Javascript">
<!--
if (flashDetected!=true) {
    document.location = "menu.htm";
}
else {
    document.location = "indfla.htm";
}
//-->   
</SCRIPT>
</head>
- det her virker for mig
Avatar billede olebole Juniormester
20. februar 2000 - 17:15 #2
<ole>
Eller bare:

<script language=JavaScript><!--
var plugin=navigator.plugins["Shockwave Flash"];
if (plugin) {
window.location='page_with_plugin.html';
}
else {
window.location='page_without_plugin.html';
}
// -->
</script>

/VH
</bole>
Avatar billede olebole Juniormester
20. februar 2000 - 17:23 #3
<ole>
Or you could act like a democrate, and let your users choose - themselves!
'...And the flash page is off course better!...'. That's what all designers would claim, but from what I see out there, they are far from always right!
That could be, why 90% would choose plain HTML...!?! ;-)
/regards
</bole>
Avatar billede zux Nybegynder
21. februar 2000 - 13:43 #4
The script will work both in Netscape and Explorer??? By the way - the flash page is not a lot of videos, animations and so on. I was careful not to use to much!
Avatar billede stroehm Nybegynder
21. februar 2000 - 14:01 #5
100% with VBScript & Mime check in Explore (MS - Does not support JavaScript only Jscript!)
100% With Javascript in Netscape !!!
:)
Avatar billede zux Nybegynder
23. februar 2000 - 14:29 #6
But my question is:
Will this script work with Internet Explorer?
Avatar billede olebole Juniormester
23. februar 2000 - 23:23 #7
<ole>
To find out I - guess what(?) - tried it ;-)
And, no...it doesen't work in IE. It tels me, that from MS's point of view 'navigator.plugins.Shockwave' is not an object :-(

Another trick I've seen done with Java-applets is creating a tiny applet, that swaps location to a Java-page. If no redirect took place (no Java-compiler present), a setTimeout() will redirect to a non-Java-page in a couple of seconds.
That must be possible to do with Flash too...onload, maybe? I'm not very much into Flash - as you might have noticed ;-)
Hope this'll help.
</ole>
Avatar billede zux Nybegynder
24. februar 2000 - 14:43 #8
Yeah I tried that, but then the Non-flash browsers set up a window who tells you "Flash is not installed, do you want to install it?" and I think that's annoying...
Avatar billede zux Nybegynder
26. februar 2000 - 21:44 #9
Can you create a JavaScript - VBscript og Jscript or anything who will work in Internet Explorer? I will pay you with another 60 points!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester