NSString *flashJsPath = [[NSBundle mainBundle] pathForResource:@"flash" ofType:@"js"];
NSString *flashJsCode = [NSString stringWithContentsOfFile:flashJsPath encoding:NSUTF8StringEncoding error:nil];
[WebView stringByEvaluatingJavaScriptFromString:flashJsPath];
[WebView stringByEvaluatingJavaScriptFromString:@"checkFlash()"];
function sendShowFlashCommand(){
var url = "+check+" + "flash";var iframe = document.createElement("IFRAME");
iframe.setAttribute("src",url);
document.documentElement.appendChild(iframe);
iframe.parentNode.removeChild(iframe);
iframe = null;
}
function checkFlash()
{
var type="application/x-shockwave-flash";
var embedEles = document.getElementsByTagName("embed");
for(var i=0;i<embedElesLength;i++)
{
if(embedEles[i].getAttribute("type")==type)
//通知有falsh;break;
sendShowFlashCommand();
}
}
