• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting "Unspecified" Java Script Error When trying to save a File.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to let the user Save a XML file using the File Download dialog box. When the user clicks "Open", the file opens just fine. When the user clicks "Save" instead of "Open", it creates a javascript "Unspecified error". However, the file still downloads just fine. But then there is the error on the page that prevents anymore javascript from running. I have put a try{}..catch() around all of my code, but I still get the error. Does anyone know what is going on? Thanks.

I found a similar post https://coderanch.com/t/117761/HTML-JavaScript/Unspecified-error-when-trying-save

They mentioned its resolved . But they didn't mentioned how . Can anyone help me to resolve this problem?

Suresh
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any Javascript involved in the file download? If so, what and why?

This error normally comes up when the document (the DOM) can't be found at all.
 
Suresh KumarS
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No i'm not using any Java Script to download. The Page has a data table from which user can select an element and export it. I wrote a Servlet to export the object into XML File. In the servlet doGet method i'm using ServletOutputStream to perform the operation.
 
Suresh KumarS
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forget to mention this. I'm facing this problem only with IE in Windows 2000 Professional. In XP no problem.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I rather mean, is there any Javascript in for example the onclick attribute of the download button?
 
Suresh KumarS
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No JavaScript for the Export Button. I'm using JSF so using action attribute of <h:commandButton></h:commandButton> to call a Java Method which will call call the servlet to export the object in xml format.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should have mentioned that before.

Which JSF implementation/version are you using?
How does the HTML output of that h:commandButton look like?
 
Suresh KumarS
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using MyFaces 1.1.5. Sorry for the late reply...
reply
    Bookmark Topic Watch Topic
  • New Topic