Helo,
i load a pagepart via ajax but the includd js code isnt executed. This
is the code
<script type="text/javascript">
alert(''Test'');
Event.observe(window, ''load'', function() {
alert(''Modul loaded'');
});
</script>
<div class="TitleObject">Systemnews</div>
<div class="ListObject100" ID="Shortnews"
style="height:10%;">
Shortnews:
</div>
<div class="TitleObject">Termine & Aufgaben</div>
<div class="ListObject100" ID="TermineundAufgaben"
style="height:30%;">
Termine & Aufgaben:
</div>
<div class="TitleObject">Waren- /
Bestellübersicht</div>
<div class="ListObject100" ID="Warenliste"
style="height:40%;">
Warenliste:
</div>
Both alerts not executed:( Why? How can i fxix this? I need a way to
load something after this code is insert:(
____________
Virus checked by G DATA AntiVirusKit
Version: AVK 17.7537 from 09.09.2007
Virus news: www.antiviruslab.com
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
You can''t do exactly that, as the window has already loaded :)
Insertion in the dom via ajax does not trigger any events.
Just add at the end of your ajax response the script
<script type="text/javascript">
alert("module loaded");
</script>
Just be sure to add evalScripts: true to your Ajax.Request or
Ajax.Updater options.
-Nicolas
On 9/9/07, retacom-Mmb7MZpHnFY@public.gmane.org
<retacom-Mmb7MZpHnFY@public.gmane.org> wrote:>
> Helo,
>
> i load a pagepart via ajax but the includd js code isnt executed. This
> is the code
>
>
> <script type="text/javascript">
> alert(''Test'');
> Event.observe(window, ''load'', function() {
> alert(''Modul loaded'');
> });
>
> </script>
>
>
>
> <div class="TitleObject">Systemnews</div>
> <div class="ListObject100" ID="Shortnews"
style="height:10%;">
> Shortnews:
> </div>
>
> <div class="TitleObject">Termine &
Aufgaben</div>
> <div class="ListObject100" ID="TermineundAufgaben"
style="height:30%;">
> Termine & Aufgaben:
> </div>
>
> <div class="TitleObject">Waren- /
Bestellübersicht</div>
> <div class="ListObject100" ID="Warenliste"
style="height:40%;">
> Warenliste:
> </div>
>
>
>
>
> Both alerts not executed:( Why? How can i fxix this? I need a way to
> load something after this code is insert:(
>
>
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 17.7537 from 09.09.2007
> Virus news: www.antiviruslab.com
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
I have a similar problem - I''m also loading a site with AJAX and I
have the script tag at the end of the document that I''m loading:
<script>
alert("Bruce")
</script>
This works perfectly fine in FF, but not in IE (just doesn''t execute
the code)...?
evalScripts is set to true, but am I forgetting something else?
Thanks!
Mickster
On Sep 9, 7:58 pm, "Nicolás Sanguinetti"
<godf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> You can''t do exactly that, as the window has already loaded :)
> Insertion in the dom via ajax does not trigger any events.
>
> Just add at the end of your ajax response the script
>
> <script type="text/javascript">
> alert("module loaded");
> </script>
>
> Just be sure to add evalScripts: true to your Ajax.Request or
> Ajax.Updater options.
>
> -Nicolas
>
> On 9/9/07, reta...-Mmb7MZpHnFY@public.gmane.org
<reta...-Mmb7MZpHnFY@public.gmane.org> wrote:
>
>
>
> > Helo,
>
> > i load a pagepart via ajax but the includd js code isnt executed. This
> > is the code
>
> > <script type="text/javascript">
> > alert(''Test'');
> > Event.observe(window, ''load'', function() {
> > alert(''Modul loaded'');
> > });
>
> > </script>
>
> > <div class="TitleObject">Systemnews</div>
> > <div class="ListObject100" ID="Shortnews"
style="height:10%;">
> > Shortnews:
> > </div>
>
> > <div class="TitleObject">Termine &
Aufgaben</div>
> > <div class="ListObject100"
ID="TermineundAufgaben" style="height:30%;">
> > Termine & Aufgaben:
> > </div>
>
> > <div class="TitleObject">Waren- /
Bestellübersicht</div>
> > <div class="ListObject100" ID="Warenliste"
style="height:40%;">
> > Warenliste:
> > </div>
>
> > Both alerts not executed:( Why? How can i fxix this? I need a way to
> > load something after this code is insert:(
>
> > ____________
> > Virus checked by G DATA AntiVirusKit
> > Version: AVK 17.7537 from 09.09.2007
> > Virus news:www.antiviruslab.com
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---