Hi to all,
Hope you all will be fine.Please tell me what's wrong with this code, why it is not working on internet explorer 6 even i check the browsers which the user is running, works fine on some browser but not on all browser and on also different versions.
<?php
$id = $_GET['Uniqueid'];
$uname = $_GET['Username'];
?>
<script language="JavaScript">
<!--
function test()
{
var UNI = document.applets.TestApp;
var subor = UNI.getFile();
alert(subor);
return false;
}
//-->
</script>
<head>
<body onLoad = "checkBrowser();" >
<noscript>
<p> This site requires a browser that support <b>JavaScript</b>.</p>
<p>If Scripting is enable then click on the <b>ActiveX control bar</b> and then click on <b>Allow Blocked Content</b> and finally click on <b>Yes</b>.</p>
<p>To enable <b>JavaScript</b> in Internet Explorer follow these steps: </p>
<ol>
<li>Open Internet Explorer.</li>
<li>On the <b>Tools</b> menu, click <b>Internet Options</b>.</li>
<li>On the <b>Security tab</b>, click <b>Internet</b>. </li>
<li>Click <b>Custom Level</b>.</li>
<li>Scroll down to <b>Active scripting</b>. </li>
<li>Click <b>Enable (or Prompt)</b>.</li>
<li>Click <b>OK</b>. </li>
<li>Click <b>Yes</b>. </li>
<li>Click <b>OK</b>. </li>
</ol>
<p><b>Mozilla Corporation's Firefox version</b></p>
<ol>
<li>On the <b>Tools</b> menu, click <b>Options</b>. </li>
<li>On the <b>Content</b> tab, click to select the <b>Enable JavaScript</b> check box. </li>
<li>Click the <b>Go back one page</b> button to return to the previous page, and then click the <b>Reload current page</b> button to run scripts. </li>
</ol>
<p><b>Opera Software's Opera version 9</b></p>
<ol>
<li>On the <b>Tools</b> menu, click <b>Preferences</b>. </li>
<li>On the <b>Advanced</b> tab, click <b>Content</b>. </li>
<li>Click to select the <b>Enable JavaScript</b> check box, and then click <b>OK</b>. </li>
<li>Click the <b>Back</b> button to return to the previous page, and then click the <b>Reload</b> button to run scripts. </li>
</ol>
<p><b>Netscape browsers</b></p>
<ol>
<li>Select <b>Edit, Preferences,Advanced</b> </li>
<li>Click to select <b>Enable JavaScript</b> option. </li>
</ol>
</noscript>
<SCRIPT language="JavaScript">
<!--hide
function checkJava(isJavaEnabled){
if("navigator" in window){
if(!isJavaEnabled){
alert( "Enable your java to experience this java enhanced page or\ntry install it..." );
location.href = "InstallingJAVA.html";
window.open( "InstallingJAVA.html", "JAVA Installation Manual", "width=500, height=500, location=0, scrollbars=1, toolbar=0" );
}
}
}
//-->
</SCRIPT>
<script language="Javascript" type="text/javascript">
function checkBrowser(){
var isInternetExplorer = (/MSIE (\d+\.\d+);/.test(navigator.userAgent)); //return true or false
var isFirefox = (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent));
if(isInternetExplorer || isFirefox){
var version=new Number(RegExp.$1); // capture x.x portion and store as a number
var browserName = navigator.appName;
if(browserName && version){
var isJavaEnabled =navigator.javaEnabled(); //return true or false
checkJava(isJavaEnabled);
}
}
}
</script>
<?php
$applet='<APPLET CODE = "CapturePlayback1.class" ARCHIVE = "CapturePlayback1.jar" WIDTH = "240" HEIGHT = "210" NAME = "BrightAmericans" MAYSCRIPT = true>
<PARAM NAME="uid" VALUE="'.$id.'">
<PARAM NAME="uname" VALUE="'.$uname.'">
</APPLET> ';
echo $applet;
?>
</body>
</head>
I also tries it by putting functions in the <head> section. Please help me, the problem is this code is not showing message on internet explorer 6 that java is not installed. why this is happening? Please help . If i only run JavaScript functions checkBrowser() it works fine on any explorer but when i put the code in this file it didn't work.. Can any one tell me why? I also close the head like <head></head> and then put the code in the body but the result was same. Please help
Thank you