Title: Javascript google map in site
Last modified: August 22, 2016

---

# Javascript google map in site

 *  Resolved [nemoein](https://wordpress.org/support/users/nemoein/)
 * (@nemoein)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-google-map-in-site/)
 * Hi evryone, it’s my first post here.
    I’ve tried to put some JavaScripts into
   new post or pages, the code is working properly on other sites but dont in wordpress,
   I’ve changed writing mode from Visual to text and paste my code, try to install
   some plugins, insert code in iframe, and anyone can’t works my code: “ <div id
   =”map” style=”width: 650px; height: 500px;”></div>
 *  <script type=”text/javascript”>
    var locations = [ [‘ Częstochowa ‘, 50.797301,
   19.0562043 , 49 ], [‘ Gdańsk ‘, 54.3349184 , 18.6520926 , 50 ], [‘ Warszawa ‘,
   52.2247434 , 20.9905342 , 51 ], [‘ Poznań ‘, 52.377827 , 16.8831355 , 52 ], [‘
   Jasło ‘, 49.7266513 , 21.4516216 , 53 ], [‘ Rzeszów ‘, 50.0166035 , 22.006821,
   54 ],
 *  ];
 *  var map = new google.maps.Map(document.getElementById(‘map’), {
    zoom: 6, center:
   new google.maps.LatLng(52.07, 19.48), mapTypeId: google.maps.MapTypeId.ROADMAP});
 *  var infowindow = new google.maps.InfoWindow();
 *  var marker, i;
 *  for (i = 0; i < locations.length; i++) {
    marker = new google.maps.Marker({ 
   position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map });
 *  google.maps.event.addListener(marker, ‘click’, (function(marker, i) {
    return
   function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker);}})(
   marker, i)); } </script> “ can you give me some advice?

Viewing 1 replies (of 1 total)

 *  Thread Starter [nemoein](https://wordpress.org/support/users/nemoein/)
 * (@nemoein)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-google-map-in-site/#post-5780333)
 * I’ve solved this problem after over 2 days searching, I had just install this
   plugin [https://wordpress.org/plugins/insert-html-snippet/](https://wordpress.org/plugins/insert-html-snippet/)
   and followe steps in this video: [https://www.youtube.com/watch?v=BmxdPCwz4RI](https://www.youtube.com/watch?v=BmxdPCwz4RI)
 * ps. sory for my bad english

Viewing 1 replies (of 1 total)

The topic ‘Javascript google map in site’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [java-script](https://wordpress.org/support/topic-tag/java-script/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [nemoein](https://wordpress.org/support/users/nemoein/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-google-map-in-site/#post-5780333)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
