0

I'm trying to add a simple google map to my website that include jQuery . The only error I get is :

GET http://code.jquery.com/jquery.min.map 404 (Not Found)  

And here are the relevant code parts , all the plugins in the head :

<!--jquery ,js scripts  -->
    <link rel="stylesheet" href="styles.css" />
    <link rel="stylesheet"href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
    <!--js scripts -->
    <script src="jsCode.js"></script> 
    <script src ="sirJson.js"></script>
    <!--gMap plugin API -->
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script src = "gmap.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

The Javascript code :

$( document ).ready(function() {
        var map = new GMaps({
        el: '#map',
        lat: 51.5073346,
        lng: -0.1276831,
        zoom: 12,
        zoomControl : true,
        zoomControlOpt: {
        style : 'SMALL',
        position: 'TOP_LEFT'
        },
    panControl : false,
    });

And last my html, jQuery div for the map :

<div data-role="main" class="ui-content">
        <div id="map"></div>
    </div>

Fixed the error - jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)

But still the map doesn't show up in the map page .

JS code :

$( document ).ready(function() {
        var map = new GMaps({
        el: '#map',
        lat: 51.5073346,
        lng: -0.1276831,
        zoom: 12,
        zoomControl : true,
        zoomControlOpt: {
        style : 'SMALL',
        position: 'TOP_LEFT'
        },
    panControl : false,
    });

map - div element .

Community
  • 1
  • 1
Itsik Mauyhas
  • 3,824
  • 14
  • 69
  • 114

3 Answers3

3

I suggest having a look at this It explains clearly what that error is about

EDIT

Being more specific. What you have to do to get rid of that error is as follows (I'm going to use jquery v1.11.0):

  1. Download the map file and the uncompressed version of jQuery. Put them with the minified version (same folder). You can get them all here

  2. Include the minified (only the minified) version into your HTML (script tag in the header).

  3. Check your preferred js debugging console to make sure that the error has disapeared.

Hope this makes things clearer.

Good luck.

Community
  • 1
  • 1
acontell
  • 6,792
  • 1
  • 19
  • 32
  • still have the same problem - - error Resource interpreted as Script but transferred with MIME type text/plain: "file:///C:/Users/Itsik/Desktop/FIXBAY/jquery-2.1.1.min.map". fixBay.html:17 Uncaught SyntaxError: Unexpected token : jquery-2.1.1.min.map:1 GET http://code.jquery.com/jquery.min.map 404 (Not Found) fixBay.html:14 – Itsik Mauyhas Sep 21 '14 at 09:57
  • 1
    @ItsikMauyhas According to your post, it looks like you've managed to get rid of the 404 error. I can't see any problem in your code and the map shows up ( as you can see here [fiddle](http://jsfiddle.net/xUUxn/1786/) ). The only thing I can come up with is that your css is not correct (you're not giving the div any height, for instance). I've also noticed that the map doesn't show up if you use a percentage instead of a fixed height. – acontell Sep 21 '14 at 14:12
  • Thank u , this explains every thing i needed to know . – Itsik Mauyhas Sep 22 '14 at 07:00
1

Why you are using 2 jquery scripts.

First of all use only one script from following

 <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>


    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

and your final scripts struture would be like this:

 <link rel="stylesheet" href="styles.css" />
    <link rel="stylesheet"href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
    <!--js scripts -->
    <script src="jsCode.js"></script> 
    <script src ="sirJson.js"></script>
    <!--gMap plugin API -->
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script src = "gmap.js"></script>
Mr7-itsurdeveloper
  • 1,631
  • 2
  • 17
  • 24
  • Uncaught SyntaxError: Unexpected token : jquery-1.9.1.min.map:1 GET code.jquery.com/jquery.min.map 404 (Not Found) code.jquery.com/jquery.min.map:1 - error , how to include this file so it will work ? and what to disable so it will start using that – Itsik Mauyhas Sep 21 '14 at 10:09
0

jQuery includes a sourceMappingURL for easier debugging of minified code you can get the map file from http://code.jquery.com/jquery-1.9.1.min.map.

Kyle Needham
  • 3,379
  • 2
  • 24
  • 38
  • so after adding this file , what jQuery link i can delete ? – Itsik Mauyhas Sep 21 '14 at 05:50
  • Uncaught SyntaxError: Unexpected token : jquery-1.9.1.min.map:1 GET http://code.jquery.com/jquery.min.map 404 (Not Found) code.jquery.com/jquery.min.map:1 - error , how to include this file so it will work ? and what to disable so it will start using that . – Itsik Mauyhas Sep 21 '14 at 10:08
  • 1
    @ItsikMauyhas Put it in the same place you have jQuery. – Kyle Needham Sep 21 '14 at 10:45