SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru adammc's Avatar
    Join Date
    Aug 2004
    Location
    Cairns, Australia
    Posts
    762
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with link - new window

    HI folks,

    I am really stuck as to why my new window wont open in I.E but works fine in Firefix??

    My only guess is a popup blocker?

    <li><a href="#" onClick="window.open('online-chat/index.php','Krishna Chat','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=488,left=380,top=120');return false;">Chat Rooms</a></li><br />

    When I click the link above in I.E 7, no window appears.
    In Firefox, it works perfectly?

    Can anyone help?

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The second argument to window.open() should not contain any spaces. All options that can be disabled in the third argument are automatically disabled if they aren't specified if any option is specified. (Newer browsers don't allow some options to be disabled)

    Also your code is not accessible -- that link won't work if JavaScript is disabled.

    Also, <li>s are the only elements that may be direct children of <ul>s and <ol>s. An <li> should never have the same parent as a <br>. If you want space between <li>s, use CSS.

    Use this.
    Code:
    <li><a href="online-chat/index.php" 
    onclick="var w=window.open(this.href,'KrishnaChat', 'width=600,height=488,left=380,top=120');return !w;"
    >Chat Rooms</a></li>
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •