Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onerror event - handle severall errors ?

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Joined
Feb 6, 2002
Messages
1,851
Location
IL
HI,

I need to handle multiple onerror events,and display DIFFERENT messages.
The code is like:

<LI><a HREF="Javascript:void(0)" onclick="Run2('dbviewer.exe d:/temp/POD/DBfiles/PopupMessages.mdb');" >PopupMessages.mdb</A></li>
<LI><a HREF="Javascript:void(0)" onclick="Run('TraceDecoder.exe d:/temp/POD/TraceOutput');" >TraceDecoder</A></li>

#######################
I was trying to achieve the goal by defining "Run" and "Run2" separate functions with separate errors (see below),but the system always shows just the latest defined function ...Will appreciate help.The functions are:
#######################

<script language='javascript'>
function Run(what){
WSH = new ActiveXObject("WScript.Shell");
WSH.Run(what);
}

onerror=handleErr
var txt=""

function handleErr(msg,url,l)
{
txt="DBViewer.exe was not found on your desktop !\n\n"
alert(txt)
return true
}
</SCRIPT>

<script language='javascript'>
function Run2(what){
WSH1 = new ActiveXObject("WScript.Shell");
WSH1.Run2(what);
}
onerror=handleErr2
var txt2=""

function handleErr2(msg,url,l)
{
txt2="DBViewer.exe was not found on your system !\n\n"
txt2+=".mdb files can be viewed on DFE only.\n\n"
alert(txt2)
return true
}
</SCRIPT>



Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top