Hi,

Your code is working fine for me with IE6 (and I'm making sure that
the script comes from a different domain; I even had it created by PHP
using exactly your code, and did nothing to make sure that the PHP
result was being served with the correct content-type, although I'd
recommend doing that). I get the alert just fine -- and immediately,
not on refresh.

Here's the test page I used, maybe there's some subtle difference that
will help you figure out what's going wrong:
http://pastie.org/869996

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com

On Mar 13, 1:43 am, JoJo <tokyot...@gmail.com> wrote:
> I'm doing some cross-site AJAX hack by dynamically inserting a script
> tag. This script tag loads a PHP script that prints out javascript:
>
> <?php
>    echo "alert('i am a cross site script');"
> ?>
>
> $$('head').first().appendChild(
>    new Element(
>       'script', {
>          id: 'scriptTag',
>          type: 'text/javascript',
>          src: 'http://www.externalSite.com/script.php'
>       }
>    )
> );
>
> On every browser but IE6, this works. On IE6, the javascript will only
> be executed when you refresh the page. It will not run when you
> initially click into the page. My idea was to have IE6 eval the
> contents of this script with eval($('scriptTag').innerHTML). It failed
> because the innerHTML is always empty, no matter which browser you try
> to do it on. So how do I get the contents of the script tag?

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to