views:

76

answers:

1

Hi Guys! I have a small problem here which I really am quite stuck in right now

My problem:

when a connection to google maps loads slowly, the rest of my JS files wati for the connection to be finished

What I want to do

Load all my JS files before a connection to google maps is made

Is there any way to do this?

A: 

Put your scripts early in the head. And you can load scripts synchronously (only if you need to load them in right order) like this (jQuery):

$.ajax({
    url: js_base+script.split('.').join('/')+'.js', //mine specific. you can use simple '/js/a.js' url
    type: 'get',
    dataType: 'script',
    async: false,
    global:false,
});
NilColor