Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    I'm trying to open a window using window.open("about:blank",window1); and it works fine, but when i try to access the title of my new popup, window1.title, i get an error saying window1 in undefined.

    Anyone know how to correctly access a popup like this?
    If its not in Family Guy its not worth it.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    try window1.document.title ??

    if that doesn't work, try

    window1 = window.open("about:blank");

  4. #3
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    ok cool, thats one error down. now ive got to try and fix the other ones myself. thanks
    If its not in Family Guy its not worth it.

  5. #4
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    hmm, well now its not giving me any errors, but it wont change the documents location either. Any ideas? hmmm, wait on that im testing window1.document.location
    If its not in Family Guy its not worth it.

  6. #5
    Senior Member Riat_Sila's Avatar
    Join Date
    Oct 2003
    Location
    Berkshire, UK
    Posts
    417
    Member #
    3485
    window1.document.location=('url')?

  7. #6
    Senior Member jf1288's Avatar
    Join Date
    Sep 2003
    Posts
    215
    Member #
    3300
    yea that works, but withough the parenthises
    If its not in Family Guy its not worth it.

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    window1.document.location.href = 'url'; is more specific.

  9. #8
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Keep in mind that when you are naming windows with javascript always remember the name you give the window in window.open(url,'window1',params) is the name that would be used in html.
    For example,
    [minicode]<a href="url.htm" target="window1">[/minicode]
    would open "url.htm" in the window you just opened.
    Whereas to reference and modify the properties (through javascript) of the window you opened, you need to store the window.open() process to a variable, like so:
    [minicode]var win1 = window.open(url,name,params);[/minicode]
    This creates a javscript Object that you can reference like so:
    [minicode]win1.document.title = "JavaScript PopUp Window";[/minicode]

    Hope this helps
    - Brian


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:39 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com