-3

Possible Duplicate:
How can I detect if Flash is installed and if not, display a hidden div that informs the user?

so:

var _isflash = navigator.plugins['Shockwave Flash'];  
if(_isflash == "undefined")
{
  console.log("not exists flash")
}
else
{
  console.log("flash!") 
}

why this not work?

document.write(_isflash) // undefined

if flash off, _isflash = undefined... please help me

Community
  • 1
  • 1
user1606362
  • 17
  • 1
  • 3
  • `navigator.mimeTypes ["application/x-shockwave-flash"]` – karim79 Sep 13 '12 at 12:47
  • Look at that : http://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-inf – Michael Laffargue Sep 13 '12 at 12:47
  • 1
    Not sure what the python tag is doing on this question, or django, for that matter. – Martijn Pieters Sep 13 '12 at 12:48
  • 2
    Whoa, what's with all the downvotes? The OP obviously doesn't have English as a first language, but they've made an effort to ask and provided some code. The question isn't perfect, but it's certainly answerable. – James M Sep 13 '12 at 12:50

2 Answers2

1

In your example, "undefined" is a string, so the two are not equal. This will do what you are trying to do:

if(!_isflash)
{
    console.log("not exists flash")
}
egbrad
  • 2,387
  • 2
  • 23
  • 27
0

You are expecting _isflash to be a string "undefined". You should do this:

if(_isflash == undefined)
mornaner
  • 2,424
  • 2
  • 27
  • 39