Forum Moderators: open

Message Too Old, No Replies

how ajax executes

         

sasidhar1229

6:10 am on Dec 23, 2008 (gmt 0)

10+ Year Member



Hi everybody,
I have one external JavaScript which has ajax in it.
In my html I am using this more than one time.

In that external .js file I am invoking one method.That method calls ajax code.

Here the problem is in my html I am using that .js file more than one time.

for example like this

<html>
<body>
<script type="text/javascript" src="some.js"></script>
--- some other tags here ----
<script type="text/javascript" src="some.js"></script>
</body>
</html>

Tell me the execution of this.
Will it waits until the first script overs or will it call that external script and process immediate tags and second script.

Tell the flow of this one.
Thanks.

eelixduppy

7:03 pm on Dec 23, 2008 (gmt 0)



Hello and Welcome to WebmasterWorld!

I do not know for sure, but if I had to guess I'd say that both scripts are executed independently as separate processes. That being said, I do not think the second one "waits" until the first one has finished.

brotherhood of LAN

7:08 pm on Dec 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



One way to test is use alert() in the first one, then a 10 second sleep, then another alert.

In the second one, use an alert with no sleep

If it's asynchronous then you shoulud get the second alert in the first script, at the end.