English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a problem with loading multiple javascript files asynchronously that work together. Lets say the browser is trying to load files A.js and B.js into the browser. The browser makes a request for A.js and B.js right after. B.js loads before A.js and B.js calls a function call on A.js. Because A.js has not yet loaded, the call will fail.

How do i solve this error without using server side scripting(only client side)? Is it even possible?

Thanks for reading.

2006-09-18 08:25:19 · 1 answers · asked by burnt1ce85 2 in Computers & Internet Programming & Design

1 answers

you have a couple options here.

1) include the necessary functions in one file. This removes the need for one to wait on another.

2) set received flags and check to see if the required function in A is ready, if not, check again in a minute or set a flag that is checked when A finishes loading.

Its hard to show you a code example when I'm not sure what Ajax toolkit you are using, but if you have a question, I can answer over IM.

2006-09-18 08:43:37 · answer #1 · answered by John J 6 · 0 0

fedest.com, questions and answers