SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: clear window?

  1. #1
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    clear window?

    how can I clear a window back to nothing that i opened using the window.open function...?

    thanks.

  2. #2
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think I understand what you mean...

  3. #3
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isn't really important anymore, but still would be nice to know.

    Okay, i know I can write to a window I opened with javascript by going newwindow.document.write

    but how do i clear it back to nothing without closing it and opening it again (which crashes IE quite often)?

    Can I just do newwindow.document.clear? well you cant, but you get my point (i hope).

    Okay, thanks.

  4. #4
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm.... Try:

    newwindow.document.write('')

    If it doesn't work, try:

    newwindow.document.write('v')

  5. #5
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are you talking about? I am confused.

    All those commands would do is *append* nothing, and then *append* a v.

  6. #6
    Spam Can Kill!!! Disk-t's Avatar
    Join Date
    Jul 2001
    Location
    n/a
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you want the new window to be EMPTY onClick, right?

  7. #7
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    basically i want to open a window, write to the window, clear the window (empty it), then write more to the window.

  8. #8
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know this works:

    document.open();
    document.clear();
    document.close();

    I'm not sure if just one or two of those causes that, but all three work together.

    aDog

  9. #9
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like I said before, I dont need this anymore, I wrote a work around that works even better, but thanks anyways, this will be helpful to know in the future.


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
  •