Hi,
on my page I start an ajax-request which returns rhtml-code (I use
Rails) looping over some objects. When I place the following code within
the loop my browser (FF) crashs:
<script>
var set_std_objekt = function (id) {
new Ajax.Updater(''divname'',
''/dosomestuff'', {
asynchronous:true,
evalScripts:true
})
}
</script>
<a href="#" onclick="set_std_objekt (1); return
false;"><img...></a>
What''s wrong here ?
Instead when I include the "new Ajax.Updater..." in the
onclick-attribute then it works:
<a href="#" onclick="new Ajax.Updater....; return
false;"><img...></a>
I''m new to the prototype stuff so maybe someone could give a hint :)
Thx
Jan
There were some crashing problems on Firefox 1.07 so the first thing to do
is make sure you''re running Firefox version 1.5.0.1
(http://getfirefox.com).
If it still crashes let me know and I''ll look into it more.
- Danger
On 2/28/06, Jan Deppisch <mail-5IKmqX4pxT2zF9g5/BB5cw@public.gmane.org>
wrote:>
> Hi,
>
> on my page I start an ajax-request which returns rhtml-code (I use
> Rails) looping over some objects. When I place the following code within
> the loop my browser (FF) crashs:
>
> <script>
> var set_std_objekt = function (id) {
> new Ajax.Updater(''divname'',
''/dosomestuff'', {
> asynchronous:true,
> evalScripts:true
> })
> }
> </script>
>
> <a href="#" onclick="set_std_objekt (1); return
false;"><img...></a>
>
> What''s wrong here ?
>
> Instead when I include the "new Ajax.Updater..." in the
> onclick-attribute then it works:
>
> <a href="#" onclick="new Ajax.Updater....; return
false;"><img...></a>
>
> I''m new to the prototype stuff so maybe someone could give a hint
:)
>
> Thx
> Jan
>
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Jan Deppisch wrote:> Hi, > > on my page I start an ajax-request which returns rhtml-code (I use > Rails) looping over some objects. When I place the following code within > the loop my browser (FF) crashs: > > <script> > var set_std_objekt = function (id) { > new Ajax.Updater(''divname'', ''/dosomestuff'', { > asynchronous:true, > evalScripts:true > }) > } > </script> > > <a href="#" onclick="set_std_objekt (1); return false;"><img...></a> > > What''s wrong here ? > > Instead when I include the "new Ajax.Updater..." in the > onclick-attribute then it works: > > <a href="#" onclick="new Ajax.Updater....; return false;"><img...></a>I was also having some problems with FF 1.0.x crashing when using evalScripts and some complicated Javascript. I never found the root of the problem because I have since switched to using behaviour.js (http://bennolan.com/behaviour/) and just call Behaviour.apply() in my Ajax.Updater''s onComplete function. It works flawlessly and has really cleaned up my HTML. -- Michael Peters Developer Plus Three, LP
I use FF 1.0.7, but as the page will be a public page I cannot say to the visitors "please upgrade to FF 1.5..." ;) Is there another solution? Am 28.02.2006 um 21:40 Uhr schrieb Danger Stevens:> There were some crashing problems on Firefox 1.07 so the first thing to do > is make sure you''re running Firefox version 1.5.0.1 (http://getfirefox.com).> If it still crashes let me know and I''ll look into it more.> - Danger> On 2/28/06, Jan Deppisch <mail-5IKmqX4pxT2zF9g5/BB5cw@public.gmane.org> wrote: >> >> Hi, >> >> on my page I start an ajax-request which returns rhtml-code (I use >> Rails) looping over some objects. When I place the following code within >> the loop my browser (FF) crashs: >> >> <script> >> var set_std_objekt = function (id) { >> new Ajax.Updater(''divname'', ''/dosomestuff'', { >> asynchronous:true, >> evalScripts:true >> }) >> } >> </script> >> >> <a href="#" onclick="set_std_objekt (1); return false;"><img...></a> >> >> What''s wrong here ? >> >> Instead when I include the "new Ajax.Updater..." in the >> onclick-attribute then it works: >> >> <a href="#" onclick="new Ajax.Updater....; return false;"><img...></a> >> >> I''m new to the prototype stuff so maybe someone could give a hint :) >> >> Thx >> Jan >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>
This might be the "var" bug from a while ago. Get rid of any "var" keywords in the html being returned and then it should stop crashing things. Or patch your prototype''s evalScripts method. http://dev.rubyonrails.org/ticket/3288 rahul -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Jan Deppisch Sent: Tuesday, February 28, 2006 3:53 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] browser-crash with Ajax.Updater I use FF 1.0.7, but as the page will be a public page I cannot say to the visitors "please upgrade to FF 1.5..." ;) Is there another solution? Am 28.02.2006 um 21:40 Uhr schrieb Danger Stevens:> There were some crashing problems on Firefox 1.07 so the first thingto do> is make sure you''re running Firefox version 1.5.0.1(http://getfirefox.com).> If it still crashes let me know and I''ll look into it more.> - Danger> On 2/28/06, Jan Deppisch <mail-5IKmqX4pxT2zF9g5/BB5cw@public.gmane.org> wrote: >> >> Hi, >> >> on my page I start an ajax-request which returns rhtml-code (I use >> Rails) looping over some objects. When I place the following codewithin>> the loop my browser (FF) crashs: >> >> <script> >> var set_std_objekt = function (id) { >> new Ajax.Updater(''divname'', ''/dosomestuff'', { >> asynchronous:true, >> evalScripts:true >> }) >> } >> </script> >> >> <a href="#" onclick="set_std_objekt (1); return false;"><img...></a> >> >> What''s wrong here ? >> >> Instead when I include the "new Ajax.Updater..." in the >> onclick-attribute then it works: >> >> <a href="#" onclick="new Ajax.Updater....; returnfalse;"><img...></a>>> >> I''m new to the prototype stuff so maybe someone could give a hint :) >> >> Thx >> Jan >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Thx rahul, that worked for me! Jan Am 28.02.2006 um 22:24 Uhr schrieb Rahul Bhargava:> This might be the "var" bug from a while ago. Get rid of any "var" > keywords in the html being returned and then it should stop crashing > things. Or patch your prototype''s evalScripts method.> http://dev.rubyonrails.org/ticket/3288> rahul> -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Jan > Deppisch > Sent: Tuesday, February 28, 2006 3:53 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails-spinoffs] browser-crash with Ajax.Updater> I use FF 1.0.7, but as the page will be a public page I cannot say to > the visitors "please upgrade to FF 1.5..." ;) Is there another solution?> Am 28.02.2006 um 21:40 Uhr schrieb Danger Stevens: >> There were some crashing problems on Firefox 1.07 so the first thing > to do >> is make sure you''re running Firefox version 1.5.0.1 > (http://getfirefox.com).>> If it still crashes let me know and I''ll look into it more.>> - Danger>> On 2/28/06, Jan Deppisch <mail-5IKmqX4pxT2zF9g5/BB5cw@public.gmane.org> wrote: >>> >>> Hi, >>> >>> on my page I start an ajax-request which returns rhtml-code (I use >>> Rails) looping over some objects. When I place the following code > within >>> the loop my browser (FF) crashs: >>> >>> <script> >>> var set_std_objekt = function (id) { >>> new Ajax.Updater(''divname'', ''/dosomestuff'', { >>> asynchronous:true, >>> evalScripts:true >>> }) >>> } >>> </script> >>> >>> <a href="#" onclick="set_std_objekt (1); return false;"><img...></a> >>> >>> What''s wrong here ? >>> >>> Instead when I include the "new Ajax.Updater..." in the >>> onclick-attribute then it works: >>> >>> <a href="#" onclick="new Ajax.Updater....; returnfalse;">><img...></a>>>> >>> I''m new to the prototype stuff so maybe someone could give a hint :) >>> >>> Thx >>> Jan >>> >>> >>> _______________________________________________ >>> Rails-spinoffs mailing list >>> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >>>> _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs