This week's book giveaway is in the Agile forum.
We're giving away four copies of Fixing your Scrum and have Ryan Ripley & Todd Miller on-line!
See this thread for details.
Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

I'm not sure how to make my javascript compatible with both IE and Netscape

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working with some javascript to launcha given application my problem is I don't understand Java well enough to know how make it compatible with both IE and netscape. I've never dealt with Javascript before and the code I'm using is code I copied from another site and then modified as best I could figure.
________________________________________________________________
<HTML>
<HEAD>
<TITLE>HTML CAPExp Test Page</TITLE>
</HEAD>
<BODY>
If you wish to launch NeuMICS Capacity Expert .<BR>
<SCRIPT>
function exec (command) {
if (document.layers && navigator.javaEnabled()) {
window._command = command;
window.oldOnError = window.onerror;
window.onerror = function (err) {
if (err.indexOf ("User didn't grant") != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
}
iexplorer.security.PrivilegeManager.enablePrivilege
('UniversalExecAccess');
java.lang.Runtime.getRuntime().exec(command);
window.onerror = window.oldOnError;
}
else if (document.all) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function (err) {
if (err.indexOf('utomation') != -1) {
alert('command execution of ' + window._command +
' disallowed by user.');
return true;
}
else return false;
};
var wsh = new ActiveXObject('WScript.Shell');
if (wsh)
wsh.Run(command);
window.onerror = window.oldOnError;
}
}
</SCRIPT>
<A HREF="javascript: void 0"
ONCLICK="exec('cpx'); return false;"
>
cpx
</A>
</APPLET>
</BODY>
</HTML>
_______________________________________________________________
I figure it has to do with adding some kind of if statement that will detect what type of browser and then will change the the change "iexplorer.security.PrivilegeManager.enablePrivilege" to "netscape.security.PrivilegeManager.enablePrivilege" but I'm not sure how to make that call.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might find some useful information here about browser sniffing . . .
http://www.webreference.com/js/column76/3.html
 
Chris Masters
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks that's just what I needed
 
Shiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic