Javascript 'Unspecified Error'

P

puneet.bansal

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
 
P

puneet.bansal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top