Thomas:

I tried this bit of code in scriptaculous.js and it seems to be working
fine with Safari 2.0.4 so aparently whatever it was with previous
Safari, it was fixed in 2.0.4.  Overall, the DOM implementation is
better than document.write().  So probably in the future,
scriptaculous.js can switch to DOM implemtation for JS injection when
the majority of the Safari users are upgarded to 2.0.4 or higher :).

if(scriptElem)
    {
        var script = document.createElement("script");
        script.type="text/javascript";
        script.src=libraryName;
      //  alert("loading "+libraryName);
        scriptElem.parentNode.insertBefore(script,
scriptElem.nextSibling);
    }
    else
    {
      document.write('<script type="text/javascript"
src="'+libraryName+'"></script>');

-Vivian

Thomas Fuchs wrote:
> document.write() is required for the loading technique to work on
> Safari (i think 2.0 up to 2.0.3 or something,
> because of a Safari bug that apparently got fixed).
>
> Note that _scriptaculous.js is not required_ for the other libs to
> work, so can just include (for example)
> effects.js and dragdrop.js so that drag-and-drop works. effects.js is
> required for all other libs, btw.
>
> Maybe it's easier in this case to use the loading techniques included
> with GWT? (no idea how they work,
> never used it).
>
> -Thomas
>
>
> Am 29.08.2006 um 11:57 schrieb [EMAIL PROTECTED]:
>
> >
> > Dear all
> >
> > Undoubtly you have heared about the GWT framework, which is being used
> > more and more around. One of its virtues is that it focuses on clean
> > design and strict programming rules. An interesting extension has been
> > written as part of the GWT widget library [1] which allows GWT to
> > integrate the scriptaculous effects. However there seems to be a
> > problem with the way scriptaculous loads other libraries, in this case
> > effects.js.
> >
> > It uses the document.write() technique which breaks apparently with a
> > clean DOM convention, please see the related thread [2]. Currently we
> > can use scriptaculous in a 'save' way by patching it. Since
> > scriptaculous is so an important part in GWT now, could it maybe be
> > developed also with GWT integration in mind?
> >
> > Many thanks
> > George
> >
> > [1] http://gwt-widget.sourceforge.net/
> > [2]
> > http://groups.google.com/group/Google-Web-Toolkit/browse_thread/
> > thread/7bbacc29cd11002e/21ca136160b23118
> >
> >
> > >
>
> --
> Thomas Fuchs
> wollzelle
>
> http://www.wollzelle.com
>
> questentier on AIM
> madrobby on irc.freenode.net
>
> http://www.fluxiom.com :: online digital asset management
> http://script.aculo.us :: Web 2.0 JavaScript
> http://mir.aculo.us :: Where no web developer has gone before


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to