i see:

jQuery XS AJAX Plugin Demo

output of script #1: i=14
output of script #2: j=49

1. start sequence
2. end sequence

line 2+3 are continuesly counting up after a short display: script x loaded

safari 2.0.4 tiger ppc

cheers,
 robert

2007/4/12, Ralf S. Engelschall <[EMAIL PROTECTED]>:

On Thu, Apr 12, 2007, Ralf S. Engelschall wrote:

>
> On Thu, Apr 12, 2007, Remy Sharp wrote:
>
> > [...]
> > The reason it doesn't work in Safari is because the script element
> > doesn't fire any events when the external library is loaded, and hence
> > listening for the onreadystatechange doesn't work.
> > [...]
>
> I've checked the latest sources from WebKit SVN trunk now and it looks
> WebKit actually emits a "load" event. So, in Safari a $(...).load(...)
> should just work fine. At least I've removed the Safari related hack
> I've taken over from jQuery core for now...

Ok, I've looked deeper into the WebKit sources and the
source WebKit/WebCore/html/HTMLTokenizer.cpp shows in
the function HTMLTokenizer::notifyFinished() an explicit
"EventTargetNodeCast(n.get())->dispatchHTMLEvent(loadEvent, false,
false);" which seems to emit the "load" event for the <script> tag. And
this line exists already since a longer time in WebKit. So, as long as
one uses a not too ancient Safari, I would expect that the "load" event
on a <script> fires just fine.

Unfortunately I've no Safari available myself, so can someone with a
recent Safari please go to...

http://trainofthoughts.org/repo-export/jquery/jquery.xsajax.test.html

...and see whether you see the expected output...

| 1. start sequence
| 2. end sequence
| 3. loaded script 1
| 4. loaded script 2

...occurs. If you only see the first two lines, we still have a problem
with Safari. If the last two lines also are visible it means the "load"
event fired just fine in Safari.

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com


Reply via email to