Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
  1. La community italiana di SEO, marketing digitale e AI
  2. Categorie
  3. Coding e Sistemistica
  4. CMS & Piattaforme Self-Hosted
  5. caricare un file.js esterno dopo il load della pagina.

caricare un file.js esterno dopo il load della pagina.

Pianificato Fissato Bloccato Spostato CMS & Piattaforme Self-Hosted
3 Post 2 Autori 679 Visualizzazioni 1 Seguito
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • C
    C
    claire
    scritto su ultima modifica di
    User Attivo 0
    #1
    caricare un file.js esterno dopo il load della pagina.

    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'è.
    il js esterno è il seguente e si chiama functions.js

    [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 ) && 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 > 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 = '<div class="'+ $.bgmp.prefix + 'placemark"> <h3>'+ title +'</h3> <div>'+ details +'</div> </div>';[/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( '<p>' + $.bgmp.name + " error: couldn't add map placemarks.</p>");      // 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]
    

    nella pagina dove lo devo caricare ho messo dopo il body

    [COLOR=#2E8B57][FONT=Monaco]<script>[/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]</script>[/FONT][/COLOR]
    

    ​dove sto sbagliando?
    grazie in anticipo per l'aiuto

    1 Risposta Ultima Risposta
    Miglior risposta 0
    0
    • U
      U
      ultima
      Moderatore
      scritto su ultima modifica di
      User Attivo 15
      #2

      Ciao Claire,
      la console errori che dice?
      Il percorso del file è corretto?

      1 Risposta Ultima Risposta
      Miglior risposta 0
      0
      • C
        C
        claire
        scritto su ultima modifica di
        User Attivo 0
        #3

        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....

        1 Risposta Ultima Risposta
        Miglior risposta 0
        0

        Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

        Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

        Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

        Registrati Accedi
        Rispondi
        • Risposta alla discussione
        Effettua l'accesso per rispondere
        • Da Vecchi a Nuovi
        • Da Nuovi a Vecchi
        • Più Voti


        • Accedi

        • Non hai un account? Registrati

        • Accedi o registrati per effettuare la ricerca.
        • Primo post
          Ultimo post
        Home Accedi Registrati
        Menu
        • CATEGORIES
        • La Community Connect.gt
        • Presentati alla Community
        • News Ufficiali da Connect.gt
        • Internet News
        • A Scuola Di
        • Digital Marketing
        • Intelligenza Artificiale
        • SEO & GEO
        • Web Marketing e Content
        • Google Analytics e Web Analytics
        • Google Ads & Advertising
        • YouTube
        • TikTok, Instagram e altri Social
        • Google Adsense, Affiliazioni e Guadagno
        • E-Commerce
        • Coding e Sistemistica
        • Help Center: consigli per il tuo progetto
        • Hosting e Cloud
        • Coding
        • CMS & Piattaforme Self-Hosted
        • Annunci e Collaborazioni
        • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
        • Collaborazioni WEB e Lavoro: offro e cerco
        • Impresa, Fisco e Leggi
        • Consulenza Legale e Professioni Web
        • Consulenza Fiscale, Imprese, Startup e P.Iva
        • Gli Off Topic
        • PC, Smartphone e altri Hardware
        • Tutti i Software
        • GT Fetish Cafè
        • Discussioni
        • Non letti 0
        • Recenti
        • Hashtag
        • Popolare
        • Utenti
        • Privacy
        • Termini e condizioni
        • © 2026 Search On Media Group S.r.l.