473,385 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Javascript 'Unspecified Error'

Hi,

I have a frameset and in one of the frames I have two functions.
This code resides in a frame named leftFrame -

//This function downloads an Excel report
function downloadExcelReport()
{
var selectObj = top.topFrame.document.getElementById('id_chain');
document.forms[0].chain.value =
selectObj.options[selectObj.selectedIndex].value;
document.forms[0].submit();
}

//This function changes the text of an <LI> item onmouseover event
function setinstructions(message)
{
var obj = document.getElementById('instr_text'); //Line 1
obj.innerText = message;
}

When downloadExcellReport() completes it gives the user open/save
option for downloading the Excel file. If the user choses to open the
file, then the setinstructions function works fine and the LI text is
updated, however if the user choses to save the file, then Line 1
produces a javacript error 'Unspecified Error'. I am unable to figure
out the connection between the two. Anybody has any idea what could be
causing this problem.

Thanks.
Puneet

Jul 23 '05 #1
1 8686
I solved the problem. When the user downloads and saves the file, the
reference to current document object is lost and hence any subsequent
reference to document object gives error. I declared a global
javascript variable that references the document object. If I use this
variable, I get the proper reference even after the file save.

Puneet

pu***********@wipro.com wrote:
Hi,

I have a frameset and in one of the frames I have two functions.
This code resides in a frame named leftFrame -

//This function downloads an Excel report
function downloadExcelReport()
{
var selectObj = top.topFrame.document.getElementById('id_chain');
document.forms[0].chain.value =
selectObj.options[selectObj.selectedIndex].value;
document.forms[0].submit();
}

//This function changes the text of an <LI> item onmouseover event
function setinstructions(message)
{
var obj = document.getElementById('instr_text'); //Line 1
obj.innerText = message;
}

When downloadExcellReport() completes it gives the user open/save
option for downloading the Excel file. If the user choses to open the
file, then the setinstructions function works fine and the LI text is
updated, however if the user choses to save the file, then Line 1
produces a javacript error 'Unspecified Error'. I am unable to figure
out the connection between the two. Anybody has any idea what could be
causing this problem.

Thanks.
Puneet


Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment;...
2
by: Cy | last post by:
Hi, I have a menu that toggles correctly in IE but is failing in FireFox V.1 and Netscape 7.1. The FireFox JavaScript Console is returning the following error; Error:...
5
by: Dave | last post by:
Hi All C# ADSI samples that I run cause unspecified errors. If I translate them into VB.NET they run fine. Here's an example: public string getEmail(string LDAPPath, string username) {...
4
by: RM | last post by:
Had VS .Net 2002 installed on W2k Server SP3 and supported a number of web sites. Installed VS .Net 2003 on Friday and now all web sites using .Net & MS ACCESS get this strange error upon open. ...
2
by: Jim Lacenski | last post by:
I have a VB class that uses .NET and ADODB to write into an Excel spreadsheet (via Jet) on a server as part of a web application. ADODB is used instead of ADO.NET because it greatly simplifies the...
1
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by...
1
by: Siegfried Heintze | last post by:
I'm using a third party hosting service. I presently have a Web Service on this hosting service's server that loads and executes a native mode DLL. This demonstrates that the hosting service has...
7
by: Jim McGivney | last post by:
ASPX page from VS.net-C# on host's computer using oleDataAdaptor to connect to Microsoft Access database. The page loads, but when connection to the database is attempted to fill a datagrid the...
0
by: Jonathan | last post by:
Hi Everyone, I have a problem which I've been able to reproduce with a nice and small test ASP.NET web application. The page sets the window.onbeforeunload event so that we will get an Ok/Cancel...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.