SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    popup ignored in IE?

    This pagehttp://www.chris-rawlins.com/delete/practice.html



    has a link that opens a popup, except IE ignores the popup dimensions and just loads the page?

    Does IE not understand getElementsByTagName or getAttribute?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Internet Explorer uses allLinks[i].getAttribute('className')
    Most other browser use allLinks[i].getAttribute('class')

    The cross-browser solution is to use allLinks[i].className

    Your code will work with this:

    Code javascript:
    ...
    if (allLinks[i].className == "popup") {
    ...

    ps. space separate keywords from parenthesis to help prevent confusion with function parameters
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Guru tictike's Avatar
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    863
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perfect. Thanks.


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
  •