SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Issue in window.write using with that of document.execCommand

    Hi All,

    I am facing a problem in javascript using document.execCommand.

    Problem:
    i am using document.write(xmlString) for writing the xmlString into a local disk file using the command document.execCommand('SaveAs',false,'filename.PFT');

    Here the problem is when iam using document.write command followed by document.execCommand the XML string which i want to write in the 'filename.pft' is working fine but the string is also appearing on the browser which it should not appear.

    Is there any alternate to perform this action...

    can any one who provide me the solution will be greatly appriaciated .

    From,
    Venkat.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    No, there is no alternative, the content must be written to the document before it can be saved.

    You can however clear the content afterwards, or have a separate window write the content then save it before closing the window again.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •