Search Results

Search found 7 results on 1 pages for 'teddyk'.

Page 1/1 | 1 

  • JavaScript - Why does google-maps wait until jquery finishes download?

    - by Teddyk
    I'm using the following Google Maps autload (asynchronous) to load asynchronous both Google Maps v3 and JQuery, like so: <script type="text/javascript" src="http://www.google.com/jsapi?autoload={ "modules":[ {name:"maps",version:3,other_params:"sensor=false"},{"name":"jquery","version":"1.4.2"},{"name":"jqueryui","version":"1.8.1"} ]}"></script> However, looking at the network traffic, it appears that it is not downloading asynchronously. Question: Does anyone understand why the %7Bcommon (google-maps) file is being delayed from download until the jquery-ui.min file completes download first?

    Read the article

  • whJavaScript: how to create a JS event that requires 2 seperate JS files to be loaded first while d

    - by Teddyk
    I want to perform asynchronous JavaScript downloads of two files that have dependencies attached to them. function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google.com/gmaps.js'); addScript('http://jquery.com/jquery.js'); function requiresJQuery() { ... } function requiresGmaps() { ... } function requiresBothJQueryGmaps() { ... } // do some work that has no dependencies on either JQuery or Google maps ... // now call a function that requires Gmaps to be loaded if (GmapsIsLoaded) { requiresGmaps(); } // then do something that requires both JQuery & Gmaps (or wait until they are loaded) if (JQueryAndGmapsIsLoaded) { requiresBothJQueryGmaps(); } Question: How can I create an event to indicate when: JQuery is loaded? Google Maps is loaded JQuery & Google Maps are both loaded?

    Read the article

  • JavaScript: how to create a JS event that requires 2 seperate JS files to be loaded first while down

    - by Teddyk
    I want to perform asynchronous JavaScript downloads of two files that have dependencies attached to them. // asynch download of jquery and gmaps function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google.com/gmaps.js'); addScript('http://jquery.com/jquery.js'); // define some function dependecies function requiresJQuery() { ... } function requiresGmaps() { ... } function requiresBothJQueryGmaps() { ... } // do some work that has no dependencies on either JQuery or Google maps ... // QUESTION - Pseudo code below // now call a function that requires Gmaps to be loaded if (GmapsIsLoaded) { requiresGmaps(); } // QUESTION - Pseudo code below // then do something that requires both JQuery & Gmaps (or wait until they are loaded) if (JQueryAndGmapsIsLoaded) { requiresBothJQueryGmaps(); } Question: How can I create an event to indicate when: JQuery is loaded? Google Maps is loaded JQuery & Google Maps are both loaded?

    Read the article

  • JavaScript: How to download JS asynchronously?

    - by Teddyk
    On my web site, I'm trying to accomplishes the fastest page load as possible. I've noticed that it appears my JavaScript are not loading asynchronously. Picture linked below. How my web site works is that it needs to load two external JavaScript files: Google Maps v3 JavaScript, and JQuery JavaScript Once it loads these external javascript files, it then, and only then, can dynamically render the page. The reason why my page can't load until both Google Maps and JQuery are loaded is that - my page, based on the geolocation (using Gmaps) of the user will then display the page based on where they are located (e.g. New York, San Francisco, etc). Meaning, two people in different cities viewing my site will see different frontpages. Question: How can I get my JavaScript files to download asynchronously so that my overall page load time is quicker?

    Read the article

  • JQuery: How do I perform a callback on JQuery once it's loaded?

    - by Teddyk
    I'm downloading JQuery asynchronously: function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('jquery.js'); // non-jquery code ... // jquery specific code like: $()... As such - how do I call my JQuery specific code once JQuery is loaded (because since I'm downloading my JavaScript asynch - it's not blocking, which is good, but is trying to execute my JQuery specific code before JQuery has been loaded).

    Read the article

1