Mickster
2007-Sep-13 11:22 UTC
How to make <script>-tags in an AJAX-loaded work also in IE?
HI there, I''m trying to load a PHP-document through AJAX that contains <script>- tags. This works perfectly fine in FF, but not in IE. I''ve tried setting type to "text/javascript", does not help. I''ve tried changing the Headers in the PHP-document, did not help. evalScripts is set to true! Does anyone know what I''m missing here? If this is a header issue, could someone please show what the correct header is supposed to look like in PHP? Thanks in advance, Mickster --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Richard Quadling
2007-Sep-13 11:24 UTC
Re: How to make <script>-tags in an AJAX-loaded work also in IE?
Try something like ...
header(''X-JSON: '' . json_encode($s_YourJSCode));
On 13/09/2007, Mickster
<micael.gustafsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> HI there,
>
> I''m trying to load a PHP-document through AJAX that contains
<script>-
> tags.
> This works perfectly fine in FF, but not in IE.
>
> I''ve tried setting type to "text/javascript", does not
help.
> I''ve tried changing the Headers in the PHP-document, did not help.
>
> evalScripts is set to true!
>
> Does anyone know what I''m missing here?
> If this is a header issue, could someone please show what the correct
> header is supposed to look like in PHP?
>
> Thanks in advance,
> Mickster
>
>
> >
>
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Mickster
2007-Sep-13 11:31 UTC
Re: How to make <script>-tags in an AJAX-loaded work also in IE?
Thanks for the extremely quick answer.
So $(s_YourJSCode) would contain e.g.
<script>alert("Bruce")</script>?
How do I then handle the response in the calling-script? Or is the
script then automatically evaluated?
Should do my homework on JSON...
Regards,
Mickster
On Sep 13, 1:24 pm, "Richard Quadling"
<rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> Try something like ...
>
> header(''X-JSON: '' . json_encode($s_YourJSCode));
>
> On 13/09/2007, Mickster
<micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
>
>
> > HI there,
>
> > I''m trying to load a PHP-document through AJAX that contains
<script>-
> > tags.
> > This works perfectly fine in FF, but not in IE.
>
> > I''ve tried setting type to "text/javascript", does
not help.
> > I''ve tried changing the Headers in the PHP-document, did not
help.
>
> > evalScripts is set to true!
>
> > Does anyone know what I''m missing here?
> > If this is a header issue, could someone please show what the correct
> > header is supposed to look like in PHP?
>
> > Thanks in advance,
> > Mickster
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer
:http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Richard Quadling
2007-Sep-13 11:33 UTC
Re: How to make <script>-tags in an AJAX-loaded work also in IE?
new AJAX.request(
''url'', {
onSuccess: function(transport, json) {
// At this stage, your json code should be evaluated.
// And no need for <script> tags on the response as this is implied.
}
);
On 13/09/2007, Mickster
<micael.gustafsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Thanks for the extremely quick answer.
>
> So $(s_YourJSCode) would contain e.g.
<script>alert("Bruce")</script>?
> How do I then handle the response in the calling-script? Or is the
> script then automatically evaluated?
>
> Should do my homework on JSON...
>
> Regards,
> Mickster
>
> On Sep 13, 1:24 pm, "Richard Quadling"
<rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
> wrote:
> > Try something like ...
> >
> > header(''X-JSON: '' . json_encode($s_YourJSCode));
> >
> > On 13/09/2007, Mickster
<micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> >
> >
> >
> >
> > > HI there,
> >
> > > I''m trying to load a PHP-document through AJAX that
contains <script>-
> > > tags.
> > > This works perfectly fine in FF, but not in IE.
> >
> > > I''ve tried setting type to "text/javascript",
does not help.
> > > I''ve tried changing the Headers in the PHP-document, did
not help.
> >
> > > evalScripts is set to true!
> >
> > > Does anyone know what I''m missing here?
> > > If this is a header issue, could someone please show what the
correct
> > > header is supposed to look like in PHP?
> >
> > > Thanks in advance,
> > > Mickster
> >
> > --
> > -----
> > Richard Quadling
> > Zend Certified Engineer
:http://zend.com/zce.php?c=ZEND002498&r=213474731
> > "Standing on the shoulders of some very clever giants!"
>
>
> >
>
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Richard Quadling
2007-Sep-13 11:34 UTC
Re: How to make <script>-tags in an AJAX-loaded work also in IE?
"should" => "will have been" On 13/09/2007, Richard Quadling <rquadling-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> new AJAX.request( > ''url'', { > onSuccess: function(transport, json) { > // At this stage, your json code should be evaluated. > // And no need for <script> tags on the response as this is implied. > } > ); > > On 13/09/2007, Mickster <micael.gustafsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanks for the extremely quick answer. > > > > So $(s_YourJSCode) would contain e.g. <script>alert("Bruce")</script>? > > How do I then handle the response in the calling-script? Or is the > > script then automatically evaluated? > > > > Should do my homework on JSON... > > > > Regards, > > Mickster > > > > On Sep 13, 1:24 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > Try something like ... > > > > > > header(''X-JSON: '' . json_encode($s_YourJSCode)); > > > > > > On 13/09/2007, Mickster <micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > > > > > > > HI there, > > > > > > > I''m trying to load a PHP-document through AJAX that contains <script>- > > > > tags. > > > > This works perfectly fine in FF, but not in IE. > > > > > > > I''ve tried setting type to "text/javascript", does not help. > > > > I''ve tried changing the Headers in the PHP-document, did not help. > > > > > > > evalScripts is set to true! > > > > > > > Does anyone know what I''m missing here? > > > > If this is a header issue, could someone please show what the correct > > > > header is supposed to look like in PHP? > > > > > > > Thanks in advance, > > > > Mickster > > > > > > -- > > > ----- > > > Richard Quadling > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > "Standing on the shoulders of some very clever giants!" > > > > > > > > > > > > > -- > ----- > Richard Quadling > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!" >-- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mickster
2007-Sep-13 11:37 UTC
Re: How to make <script>-tags in an AJAX-loaded work also in IE?
Ok, you''ve convinced me =) I''ll give it a try later! Thanks for saving me hours of troubleshooting/problem solving! Have a nice day! Regards, Mickster On Sep 13, 1:34 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> "should" => "will have been" > > On 13/09/2007, Richard Quadling <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > new AJAX.request( > > ''url'', { > > onSuccess: function(transport, json) { > > // At this stage, your json code should be evaluated. > > // And no need for <script> tags on the response as this is implied. > > } > > ); > > > On 13/09/2007, Mickster <micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanks for the extremely quick answer. > > > > So $(s_YourJSCode) would contain e.g. <script>alert("Bruce")</script>? > > > How do I then handle the response in the calling-script? Or is the > > > script then automatically evaluated? > > > > Should do my homework on JSON... > > > > Regards, > > > Mickster > > > > On Sep 13, 1:24 pm, "Richard Quadling" <rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > wrote: > > > > Try something like ... > > > > > header(''X-JSON: '' . json_encode($s_YourJSCode)); > > > > > On 13/09/2007, Mickster <micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > HI there, > > > > > > I''m trying to load a PHP-document through AJAX that contains <script>- > > > > > tags. > > > > > This works perfectly fine in FF, but not in IE. > > > > > > I''ve tried setting type to "text/javascript", does not help. > > > > > I''ve tried changing the Headers in the PHP-document, did not help. > > > > > > evalScripts is set to true! > > > > > > Does anyone know what I''m missing here? > > > > > If this is a header issue, could someone please show what the correct > > > > > header is supposed to look like in PHP? > > > > > > Thanks in advance, > > > > > Mickster > > > > > -- > > > > ----- > > > > Richard Quadling > > > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > > > "Standing on the shoulders of some very clever giants!" > > > -- > > ----- > > Richard Quadling > > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > > "Standing on the shoulders of some very clever giants!" > > -- > ----- > Richard Quadling > Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!"--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Richard Quadling
2007-Sep-13 12:17 UTC
Re: How to make <script>-tags in an AJAX-loaded work also in IE?
header(''X-JSON: alert("bob")'');
Not ideal I suppose, but it does work.
JSON is normally used for passing data (which may be objects with
methods), rather than raw JS code.
On 13/09/2007, Mickster
<micael.gustafsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Ok, you''ve convinced me =)
> I''ll give it a try later!
>
> Thanks for saving me hours of troubleshooting/problem solving!
> Have a nice day!
>
> Regards,
> Mickster
>
> On Sep 13, 1:34 pm, "Richard Quadling"
<rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
> wrote:
> > "should" => "will have been"
> >
> > On 13/09/2007, Richard Quadling
<rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> >
> >
> >
> > > new AJAX.request(
> > > ''url'', {
> > > onSuccess: function(transport, json) {
> > > // At this stage, your json code should be evaluated.
> > > // And no need for <script> tags on the response as this
is implied.
> > > }
> > > );
> >
> > > On 13/09/2007, Mickster
<micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > > > Thanks for the extremely quick answer.
> >
> > > > So $(s_YourJSCode) would contain e.g.
<script>alert("Bruce")</script>?
> > > > How do I then handle the response in the calling-script? Or
is the
> > > > script then automatically evaluated?
> >
> > > > Should do my homework on JSON...
> >
> > > > Regards,
> > > > Mickster
> >
> > > > On Sep 13, 1:24 pm, "Richard Quadling"
<rquadl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
> > > > wrote:
> > > > > Try something like ...
> >
> > > > > header(''X-JSON: '' .
json_encode($s_YourJSCode));
> >
> > > > > On 13/09/2007, Mickster
<micael.gustafs...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > > > > > HI there,
> >
> > > > > > I''m trying to load a PHP-document through
AJAX that contains <script>-
> > > > > > tags.
> > > > > > This works perfectly fine in FF, but not in IE.
> >
> > > > > > I''ve tried setting type to
"text/javascript", does not help.
> > > > > > I''ve tried changing the Headers in the
PHP-document, did not help.
> >
> > > > > > evalScripts is set to true!
> >
> > > > > > Does anyone know what I''m missing here?
> > > > > > If this is a header issue, could someone please
show what the correct
> > > > > > header is supposed to look like in PHP?
> >
> > > > > > Thanks in advance,
> > > > > > Mickster
> >
> > > > > --
> > > > > -----
> > > > > Richard Quadling
> > > > > Zend Certified Engineer
:http://zend.com/zce.php?c=ZEND002498&r=213474731
> > > > > "Standing on the shoulders of some very clever
giants!"
> >
> > > --
> > > -----
> > > Richard Quadling
> > > Zend Certified Engineer
:http://zend.com/zce.php?c=ZEND002498&r=213474731
> > > "Standing on the shoulders of some very clever giants!"
> >
> > --
> > -----
> > Richard Quadling
> > Zend Certified Engineer
:http://zend.com/zce.php?c=ZEND002498&r=213474731
> > "Standing on the shoulders of some very clever giants!"
>
>
> >
>
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---