content replicated twice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akg
    New Member
    • Jan 2007
    • 19

    content replicated twice

    Hi,
    I am using following javascript code to write some content in a window. my problem is content in the document is written twice. can someone please help me how to avoid this.

    Code:
    _newwindow = window.open('',pr_OpenWindows[index].Name,'height=690,width=775,status= no, resizable= no, scrollbars=yes, toolbar=no,location=no,menubar=no,left=' + pr_OpenWindows[index].XPos + ',top=' + pr_OpenWindows[index].YPos);
    _newwindow.document.write(resText);
    _newwindow.document.close();
    somewhere I read that I should use document.clear( ) method before using document.write( ) method but I heard that this method is not supported in most of the browsers.

    Thanks,
    Amit

    Thanks,
    Amit
    Last edited by akg; May 30 '07, 02:59 PM. Reason: change of subject
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What is the value of resText?

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Originally posted by akg
      Thanks,
      Amit

      Thanks,
      Amit
      It seems the problem is being repeated here!

      Comment

      • akg
        New Member
        • Jan 2007
        • 19

        #4
        resText contains the HTML which I am writing on this window. other thing is this content replication is not every time, it happens only occasionally.

        Amit

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by akg
          resText contains the HTML which I am writing on this window. other thing is this content replication is not every time, it happens only occasionally.
          How is resText being formed? Is it not possible that there is a bug in how it is created, i.e. it sometimes contains replicated HTML? If you post some more code, it might help.

          Comment

          Working...