Hi Maxim,

thanks for your idea, I've tested it.

- with firefox 3.5 under ubuntu
-- ajax: false and true, with one, or two script-tags and a local
script-src it always works as expected
-- with a remote file and one script-block it always works like having
stated async: true
   with two script blocks it always behaves like async: false

One now could think, fine lets use two script blocks for a remote
script, if you want async: false.

But
1. when I tested it with winxp an IE8 it always behaves like async:
true (with remote script) regardless whether you use one or two script-
blocks...

2. also, do I have some another problem using two script-blocks at
that point. The ajax call and the following statement are part of a
callback. How would you split the inner part of a function in two
script-tags.

to clarify it looks more like that:

<script>
var callback = function() {
   jQuery.ajax({
       url: 'http://someremoteurl/js/test2.js',
           async: false,
           dataType: 'script'
   });
   console.log('statement after ajax call');
}
</script>

Last but not least, before one now says:
Q: Why then don't you use the complete-callback of your ajax-call to
trigger the following statement?
A: I do not really use ajax myself, but jQuery's append-function,
which itself uses the ajax-function to call script-src's it's been
given. So it would kind of be the callback of the append-function I
need, but that would call to early, since ajax for remote scripts
seems always async, no matter the inner options call for async: false


So the main problem remains: Is it a bug, that ajax for remote scripts
is never async: false, or is it just not possible and therefore wasted
time to look into?


Greetings

Benedikt


On Jul 30, 7:24 pm, Maxim Slavutsky <maxim.slavut...@gmail.com> wrote:
> Try to work this way:   <script>
>    jQuery.ajax({
>        url: 'http://someremoteurl/js/test2.js',
>            async: false,
>            dataType: 'script'
>    });
>    </script>
>
>    <script>
>    console.log('nach ajax');
>    </script>

Reply via email to