Title: Uncaught SyntaxError in JavaScript
Last modified: March 18, 2022

---

# Uncaught SyntaxError in JavaScript

 *  [jmeile](https://wordpress.org/support/users/jmeile/)
 * (@jmeile)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-in-javascript/)
 * Dear support
 * The map is unfortunately not rendering. When I insert the code, only an empty
   map comes:
    [https://www.sss2022.ethz.ch/weg-zum-technopark-2](https://www.sss2022.ethz.ch/weg-zum-technopark-2)
 * Enable the console shows:
    `Uncaught SyntaxError: Unexpected token '<'`
 * When I click on the source, this is what I see:
 *     ```
       <p>				<script src="https://www.sss2022.ethz.ch/wp-content/plugins/osm/js/OL/6.9.0/ol.js?ver=6.9.0" type="text/javascript"></script><br />
       				<script src="https://www.sss2022.ethz.ch/wp-content/plugins/osm/js/osm-v3-plugin-lib.js?ver=1.0.0" type="text/javascript"></script><br />
       				<script src="https://www.sss2022.ethz.ch/wp-content/plugins/osm/js/osm-metabox-events.js?ver=1.0.0" type="text/javascript"></script><br />
       				<script src="https://www.sss2022.ethz.ch/wp-content/plugins/osm/js/osm-startup-lib.js" type="text/javascript"></script><br />
       				<script type="text/javascript">
       					translations['openlayer'] = "open layer";
       					translations['openlayerAtStartup'] = "open layer at startup";
       					translations['generateLink'] = "link to this map with opened layers";
       					translations['shortDescription'] = "short description";
       					translations['generatedShortCode'] = "to get a text control link paste this code in your wordpress editor";
       					translations['closeLayer'] = "close layer";
       					translations['cantGenerateLink'] = "put this string in the existing map short code to control this map";
       			  </script></p>
       <p>			  <script type="text/javascript">
       			  vectorM['map_ol3js_1'] = [];</p>
       <p>        var raster = getTileLayer("osm","NoKey");			</p>
       <p>			  var map_ol3js_1 = new ol.Map({
       				interactions: ol.interaction.defaults({mouseWheelZoom:false}),
       ```
   
 * So, the plugin is mixing html and Javascript. Why is this?
 * Best regards
    Josef
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funcaught-syntaxerror-in-javascript%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [MiKa](https://wordpress.org/support/users/photoweblog/)
 * (@photoweblog)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-in-javascript/#post-15476304)
 * Hello [@jmeile](https://wordpress.org/support/users/jmeile/) ,
 *  this is not the source generated originally by the OSM plugin. You can see the
   source generated here:
 * [https://wp-osm-plugin.hyumika.com/map-with-one-html-popup-marker-in-wordpress/](https://wp-osm-plugin.hyumika.com/map-with-one-html-popup-marker-in-wordpress/)
 * Just click on “View Page Source” in your browser and move to the same area …
 * If you did not modify the WP OSM plugin another WP Plugin could have done it.
   Do you have any caching or optimization plugins installed?
 * Br, Michael

Viewing 1 replies (of 1 total)

The topic ‘Uncaught SyntaxError in JavaScript’ is closed to new replies.

 * ![](https://ps.w.org/osm/assets/icon-256x256.png?rev=2087144)
 * [OSM - OpenStreetMap](https://wordpress.org/plugins/osm/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/osm/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/osm/)
 * [Active Topics](https://wordpress.org/support/plugin/osm/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/osm/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/osm/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [MiKa](https://wordpress.org/support/users/photoweblog/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-in-javascript/#post-15476304)
 * Status: not resolved