On Feb 2, 6:12 am, "Randy Jonasz" <[EMAIL PROTECTED]> wrote:
> On 2/1/07, Colin Mollenhour <[EMAIL PROTECTED]> wrote:
>
> > I don't use Safari so this is a guess based on experience with IE and
> > FF, but try putting the update in a try/catch block, I'm guessing that
> > some javascript in your responseText has a bug. Try catching the
> > exception and printing its details to track it down.
>
> > Btw, I always hear people talk about something "crashing Safari". Does
> > it literally crash the entire browser or are you talking about it simply
> > throwing a javascript error which halts further execution of javascripts
> > for that thread?
>
> Problem solved. I think!  Safari would crash with an illegal memory
> access being committed by the javascript core thread.  I tracked the
> problem down to the stripScripts and extractStrips extensions of
> Object.  The specific culprit was/is the regular expression saved in
> ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',  I
> changed this reg ex to
> '<script.*>(.*)<\/script>' and now safari loads and evaluates my javascript.


You seem to be having a problem with greedy operators,  which is a
problem with old (and maybe new?) Safari.  The following is lightly
tested:

var re = new RegExp( '<script.*[^(<script)]*<\\/script>','g' );

alert(s.replace(re,''));


--
Rob


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to