<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[caricare un file.js esterno dopo il load della pagina.]]></title><description><![CDATA[<p dir="auto">ciao a tutti, come da titolo sto cercando di caricare un file javascript esterno solo dopo aver caricato la pagina ( purtroppo ho dei conflitti  con il tema che mi ci costringono) ma evidentemente sbaglio qualcosa, perchè mi ritrovo con un errore. è una mappa google e invece della mappa mi appare "Basic Google Maps Placemarks error: bgmpData undefined.", se effettuo il refresh del browser la mappa invece c'è.<br />
il js esterno è il seguente e si chiama functions.js</p>
<pre><code>[COLOR=#2E8B57][FONT=Monaco]* Wrapper function to safely use $[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]*/[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]function bgmp_wrapper( $ )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]{[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]   $.bgmp = [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]   {[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]      init : function()[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         // Initialize variables[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.prefix            = 'bgmp_';[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.name               = 'Basic Google Maps Placemarks';[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.canvas            = document.getElementById( $.bgmp.prefix + 'map-canvas' );      // We have to use getElementById instead of a jQuery selector here in order to pass it to the Maps API.[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.map               = undefined;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.markerClusterer      = undefined;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.markers            = {};[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.infoWindowContent   = {};[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( typeof bgmpData === 'undefined' )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $( $.bgmp.canvas ).html( $.bgmp.name + " error: bgmpData undefined." );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            return; [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         // Initialize single info window to reuse for each placemark[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.infoWindow = new google.maps.InfoWindow( {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            content      : '',[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            maxWidth   : bgmpData.options.infoWindowMaxWidth[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         } );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         // Format numbers[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         bgmpData.options.zoom               = parseInt( bgmpData.options.zoom );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         bgmpData.options.latitude            = parseFloat( bgmpData.options.latitude );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         bgmpData.options.longitude            = parseFloat( bgmpData.options.longitude );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         bgmpData.options.clustering.maxZoom      = parseInt( bgmpData.options.clustering.maxZoom );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         bgmpData.options.clustering.gridSize   = parseInt( bgmpData.options.clustering.gridSize );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         // Register event handlers[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $( '.' + $.bgmp.prefix + 'list' ).find( 'a' ).filter( '.' + $.bgmp.prefix + 'view-on-map' ).click( $.bgmp.viewOnMap ); [/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         // Build map[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         if( $.bgmp.canvas )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $.bgmp.buildMap();[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         else[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $( $.bgmp.canvas ).html( $.bgmp.name + " error: couldn't retrieve DOM elements." );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      },[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]      buildMap : function()[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         var mapOptions;[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( bgmpData.options.mapWidth == '' || bgmpData.options.mapHeight == '' || bgmpData.options.latitude == '' || bgmpData.options.longitude == '' || bgmpData.options.zoom == '' || bgmpData.options.infoWindowMaxWidth == '' )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            // @todo update w/ cluster options?[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            $( $.bgmp.canvas ).html( $.bgmp.name + " error: map options not set." );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            return;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         mapOptions = [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'zoom'                  : bgmpData.options.zoom,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'center'               : new google.maps.LatLng( bgmpData.options.latitude, bgmpData.options.longitude ),[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'mapTypeId'               : google.maps.MapTypeId[ bgmpData.options.type ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'mapTypeControl'         : bgmpData.options.typeControl == 'off' ? false : true,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'mapTypeControlOptions'      : { style: google.maps.MapTypeControlStyle[ bgmpData.options.typeControl ] },[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'navigationControl'         : bgmpData.options.navigationControl == 'off' ? false : true,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'navigationControlOptions'   : { style: google.maps.NavigationControlStyle[ bgmpData.options.navigationControl ] },[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            'streetViewControl'         : bgmpData.options.streetViewControl[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         };[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         // Override default width/heights from settings[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $( '#' + $.bgmp.prefix + 'map-canvas' ).css( 'width', bgmpData.options.mapWidth );      // @todo use $.bgmp.canvas intead of hardcoding it?[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $( '#' + $.bgmp.prefix + 'map-canvas' ).css( 'height', bgmpData.options.mapHeight );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         // @todo this prevents users from using their own stylesheet?[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]         // Create the map[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         try[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $.bgmp.map = new google.maps.Map( $.bgmp.canvas, mapOptions );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         catch( e )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $( $.bgmp.canvas ).html( $.bgmp.name + " error: couln't build map." );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            if( window.console )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               console.log( $.bgmp.prefix + 'buildMap: '+ e );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            return;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.addPlacemarks( $.bgmp.map );     [/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         // Activate marker clustering[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         if( bgmpData.options.clustering.enabled )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            // BGMP stores markers in an object for direct access (e.g., markers[ 15 ] for ID 15), but MarkerCluster requires an array instead, so we convert them [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            var markersArray = [];[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            for( var m in $.bgmp.markers )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               markersArray.push( $.bgmp.markers[ m ] );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            $.bgmp.markerClusterer = new MarkerClusterer([/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               $.bgmp.map,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               markersArray,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  maxZoom      : bgmpData.options.clustering.maxZoom,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  gridSize   : bgmpData.options.clustering.gridSize,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  styles      : bgmpData.options.clustering.styles[ bgmpData.options.clustering.style ][/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      },[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]      isInt : function( value )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         if( !isNaN( value ) &amp;&amp; parseFloat( value ) == parseInt( value ) )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            return true;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         else[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            return false;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      },[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]      addPlacemarks : function( map )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         // @todo - should probably refactor this since you pulled out the ajax. update phpdoc too[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( bgmpData.markers.length &gt; 0 )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            for( var m in bgmpData.markers )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               $.bgmp.createMarker([/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  map,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  bgmpData.markers[ m ][ 'id' ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  bgmpData.markers[ m ][ 'title' ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  bgmpData.markers[ m ][ 'latitude' ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  bgmpData.markers[ m ][ 'longitude' ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  bgmpData.markers[ m ][ 'details' ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  bgmpData.markers[ m ][ 'icon' ],[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]                  parseInt( bgmpData.markers[ m ][ 'zIndex' ] )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      },[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]      createMarker : function( map, id, title, latitude, longitude, details, icon, zIndex )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         var infoWindowContent, marker;[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( isNaN( latitude ) || isNaN( longitude ) )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            if( window.console )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               console.log( $.bgmp.prefix + "createMarker(): "+ title +" latitude and longitude weren't valid." );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            return false;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( icon == null )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            // @todo - this check may not be needed anymore[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            if( window.console )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               console.log( $.bgmp.prefix + "createMarker(): "+ title +"  icon wasn't passed in." );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            return false;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( !$.bgmp.isInt( zIndex ) )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            //if( window.console )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               //console.log( $.bgmp.prefix + "createMarker():  "+ title +" z-index wasn't valid." );   // this would fire any time it's empty[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            zIndex = 0;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         infoWindowContent = '&lt;div class="'+ $.bgmp.prefix + 'placemark"&gt; &lt;h3&gt;'+ title +'&lt;/h3&gt; &lt;div&gt;'+ details +'&lt;/div&gt; &lt;/div&gt;';[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         try[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {   [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            // Replace commas with periods. Some (human) languages use commas to delimit the fraction from the whole number, but Google Maps doesn't accept that.[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            latitude = parseFloat( latitude.replace( ',', '.' ) );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            longitude = parseFloat( longitude.replace( ',', '.' ) );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            marker = new google.maps.Marker( {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               'bgmpID'   : id,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               'position'   : new google.maps.LatLng( latitude, longitude ),[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               'map'      : map,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               'icon'      : icon,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               'title'      : title,[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               'zIndex'   : zIndex[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            } );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            $.bgmp.markers[ id ] = marker;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $.bgmp.infoWindowContent[ id ] = infoWindowContent;[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            google.maps.event.addListener( marker, 'click', function() [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               $.bgmp.openInfoWindow( map, marker, infoWindowContent );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            } );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]            return true;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         catch( e )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            //$( $.bgmp.canvas ).append( '&lt;p&gt;' + $.bgmp.name + " error: couldn't add map placemarks.&lt;/p&gt;");      // add class for making red? other places need this too?   // @todo - need to figure out a good way to alert user that placemarks couldn't be added[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            if( window.console )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               console.log( $.bgmp.prefix + 'createMarker: '+ e );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      },[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]      openInfoWindow : function( map, marker, infoWindowContent )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.infoWindow.setContent( infoWindowContent );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.infoWindow.open( map, marker );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]         if( bgmpData.options.viewOnMapScroll )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         {         [/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            $( 'html, body' ).animate([/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]               scrollTop: $( '#' + $.bgmp.prefix + 'map-canvas' ).offset().top[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]            }, 900 );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      },[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]      viewOnMap : function( event )[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         var id = $( this ).data( 'marker-id' );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]         $.bgmp.openInfoWindow( $.bgmp.map, $.bgmp.markers[ id ], $.bgmp.infoWindowContent[ id ] );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]   }; // end bgmp[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]   // Kick things off...[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]   $( document ).ready( $.bgmp.init );[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]} // end bgmp_wrapper()[/FONT][/COLOR]

[COLOR=#2E8B57][FONT=Monaco]bgmp_wrapper( jQuery );
[/FONT][/COLOR]
</code></pre>
<p dir="auto">nella pagina dove lo devo caricare ho messo dopo il body</p>
<pre><code>[COLOR=#2E8B57][FONT=Monaco]&lt;script&gt;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]var JS = {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]  load: function(src, callback) {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]    var script = document.createElement('script'),[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]        loaded;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]    script.setAttribute('src', src);[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]    if (callback) {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      script.onreadystatechange = script.onload = function() {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]        if (!loaded) {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]          callback();[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]        }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]        loaded = true;[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]      };[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]    }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]    document.getElementsByTagName('head')[0].appendChild(script);[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]  }[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]};[/FONT][/COLOR]


[COLOR=#2E8B57][FONT=Monaco]JS.load("..../functions.js", function() {[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]    bgmp_wrapper( jQuery );[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]});[/FONT][/COLOR]
[COLOR=#2E8B57][FONT=Monaco]&lt;/script&gt;[/FONT][/COLOR]
</code></pre>
<p dir="auto">​dove sto sbagliando?<br />
grazie in anticipo per l'aiuto</p>
]]></description><link>https://dev.connect.gt/topic/211461/caricare-un-file-js-esterno-dopo-il-load-della-pagina</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 22:35:36 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/211461.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Feb 2015 16:21:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to caricare un file.js esterno dopo il load della pagina. on Fri, 27 Feb 2015 11:47:33 GMT]]></title><description><![CDATA[<p dir="auto">ciao, nessun errore. purtroppo so che c'è un problema che ho già dovuto affrontare e in altre cose ho risolto così, perchè nel sito è presente un player che riproduce musica  non-stop mentre si naviga.  E quello crea un mare di problemi, questa mappa è l'unica che non riesco in nessun modo a  caricare a meno di  ricaricare l'intera pagina, ovviamente  fermando quindi il player per un attimo quando si accede alla pagina della mappa.  non mi vengono in mente altre soluzioni....</p>
]]></description><link>https://dev.connect.gt/post/1190552</link><guid isPermaLink="true">https://dev.connect.gt/post/1190552</guid><dc:creator><![CDATA[claire]]></dc:creator><pubDate>Fri, 27 Feb 2015 11:47:33 GMT</pubDate></item><item><title><![CDATA[Reply to caricare un file.js esterno dopo il load della pagina. on Thu, 26 Feb 2015 16:57:57 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Claire,<br />
la console errori che dice?<br />
Il percorso del file è corretto?</p>
]]></description><link>https://dev.connect.gt/post/1190564</link><guid isPermaLink="true">https://dev.connect.gt/post/1190564</guid><dc:creator><![CDATA[ultima]]></dc:creator><pubDate>Thu, 26 Feb 2015 16:57:57 GMT</pubDate></item></channel></rss>