Greetings,
I’m using the following code to load a text file into a textarea on the page. The issue I’m having is that when cancel is selected, an error is thrown (“Unknown Name”).
[CODE]function Import(){
sBrowsePath = “C:\”;
sBrowseFilter = “All Files|*.*”;
oBrowseDialog = new ActiveXObject(“UserAccounts.CommonDialog”);
oBrowseDialog.Filter = sBrowseFilter;
oBrowseDialog.InitialDir = sBrowsePath;
oBrowseDialog.Flags = 0x80000 + 0x4 + 0x8;
oBrowseDialog.ShowOpen();
f=””;
f = fso.OpenTextFile(oBrowseDialog.FileName, ForReading);
$(“Trans”).value = f.ReadAll();
alert(“Import Complete”);
}
Is there a method of handling this error without sticking the following into the script to block all error?
[CODE]function blockError(){return true;}
window.onerror = blockError;