trevorhinesley
trevorhinesley

Reputation: 875

Uncaught SyntaxError: Unexpected token < in JQuery UI Maps plugin? Works locally, not on the server

I'm working on a fairly simple site using Twitter Bootstrap. I'm having an issue with getting my Google Maps plugin to work. On localhost using Apache, it works fine. On the server, also Apache, it does not. I get this error:

Uncaught SyntaxError: Unexpected token <

On the first line of this file (jquery.ui.map.min.js):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<title>Menu for /assets/js/jquery.ui.map.min.js</title>
</head><body>
<h1>Menu for /assets/js/jquery.ui.map.min.js</h1>
<hr />

<pre>          <a href="http://jhfc-law.com/assets/js/jquery-ui-map">jquery-ui-map</a></pre>
<pre>          <a href="http://jhfc-law.com/assets/js/d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new">d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new</a></pre>


</body>
</html>

Here is a link to see the problem:

http://jhfc-law.com/contact.html

Again, the map and everything work fine locally. I'm sure the server is reading that DOCTYPE line as an issue due to the opening <, but I'm unsure how to fix this. It's causing this error as well (since the first file is breaking, gmap isn't being initialized so I can't use this following line):

Uncaught TypeError: Object [object Object] has no method 'gmap'

Which is in this method in my scripts.js file (which is being loaded after the previous file):

jQuery(document).ready(function() {
    var position = new google.maps.LatLng(31.22633, -85.39422);
    $('.map').gmap({'center': position,'zoom': 15, 'disableDefaultUI':true, 'callback': function() {
Uncaught TypeError: Object [object Object] has no method 'gmap'
            var self = this;
            self.addMarker({'position': this.get('map').getCenter() }); 
        }
    }); 
});

Any help is appreciated!

T

Upvotes: 1

Views: 2039

Answers (1)

imjared
imjared

Reputation: 20584

Your map javascript isn't on the server. This is what you're linking to: http://jhfc-law.com/assets/js/jquery.ui.map.min.js

Furthermore, it looks like the correct (?) link is broken as well: http://jhfc-law.com/assets/js/jquery-ui-map

Upvotes: 2

Related Questions