www.webdeveloper.com
Results 1 to 5 of 5

Thread: window open problems

  1. #1
    Join Date
    Aug 2004
    Posts
    5

    window open problems

    hi,

    I, just want to take a question about the onClick="window.open()" command.
    So, there is a problem when i use it. If i click on the link(with this command), the window's open properly, but the website on the main window is scrolls back to the top of the page. (probably the page in the main window is reloading?)
    How could i make this without scrolling back to the top on the main window.
    So, i'm not an expert, please help!!
    thanks
    perren
    perren

  2. #2
    Join Date
    Jan 2004
    Location
    Alabama, United States
    Posts
    833
    I am unsure about that, but I do know that many browsers and pop-up blockers will prevent your window from opening. What exactly are you using it for? Perhaps there is another way.

  3. #3
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270

    Re: window open problems

    Originally posted by perren
    How could i make this without scrolling back to the top on the main window.
    First you start with something that works in all browsers:

    <a href="http://www.w3.org/">W3C</a>

    And then you add the pop-up feature for those browsers that do support it:

    <a href="http://www.w3.org/" onclick="window.open(this.href, 'child'); return false">W3C</a>

    But with some pop-up blockers you'll still end up with a broken link. And as nobody really wants a pop-up anyway, you might as well refrain from their use.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  4. #4
    Join Date
    Jan 2004
    Location
    Alabama, United States
    Posts
    833

  5. #5
    Join Date
    Aug 2004
    Posts
    5

    yesssss

    Thanks very much,

    This works(window.open(this.href, 'child', 'scrollbars=no, width=300, height=1'); return false").
    perren
    perren

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles