Posted by: tjcoppet | August 1, 2007

Safari 3 Beta

Ouch! Every piece of javascript I have that touches something in the DOM isn’t working (and I didn’t even write most of it). It looks like they are neither doing what IE/FF do, nor what Safari used to.

There’s a bunch of stuff I haven’t tracked down yet and I hope their breakages are because it’s buggy as hell and won’t be released with 10.5 — not because Apple is trying to make the next IE.


Responses

  1. Maybe “every piece of javascript” was an exaggeration. I have a site using Ajax that makes use of “visibility” resulting in “invisible” elements in all the wrong places. It sounds like I’m getting bit by this bug.

    Another waste of time. Guess I’ll wait for the next release.

  2. Making progress. Here’s another one:

    var e = document.createElement("div");

    e.style is null. Now, if I change the mime type from application/xhtml+xml to text/html, e.style is no longer null and it works fine.

    is this a Safari bug? Is the style object no longer the way to set styles? Tell people to use Firefox instead?

  3. Foo on me. In XHTML, elements need to be created using a namespace, as if it couldn’t use the same namespace the rest of the document is using. Anyway, the key method is: document.createElementNS(namespace, name);

    It may come as a shocker but IE6 doesn’t know of this method. So, I end up having to make my own function and change the references throughout (thus the everywhere comment).


    function createElement(element) {
    if ((navigator && navigator.userAgent && navigator.userAgent.indexOf("MSIE 6") >= 0)) {
    return(document.createElement(element));
    } else {
    return(document.createElementNS("http://www.w3.org/1999/xhtml", element));
    }
    }


Leave a comment

Categories