Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was working on reading xmlfile and ploting it on google map using jquery ajax.....using this function it works just fine on visual studio 2013 but when i move to visual studio 2010
the part from $.ajax doesn't work ...i've included jquery jquery-1.4.1.js at the header help....

JavaScript
function myFunction() {
    alert('hello');
    var fname = document.getElementById('<%=hidden.ClientID%>').value;
    alert(fname);
    var mapOptions =
                {
                    zoom: 13,
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                }
    var infowindow = new google.maps.InfoWindow();
    var map = new google.maps.Map(document.getElementById('displayMap'), mapOptions);

    $.ajax({
        type: "GET",
        url: "Location\\" + fname + "",
        dataType: "xml",
        success: function (xml) {
            $(xml).find("Location").each(function () {
                Loc = $(this).find("Loc_Name").text();
                Lat = $(this).find("Latitude").text();
                Long = $(this).find("Longitude").text();
                var loc = new google.maps.LatLng(Lat, Long);

                map.setCenter(loc);

                var marker = new google.maps.Marker({
                    position: new google.maps.LatLng(Lat, Long),
                    map: map,
                    title: 'My workplace',
                icon: 'http://google-maps-icons.googlecode.com/files/factory.png'

                });


                google.maps.event.addListener(marker, 'click', function () {

                    infowindow.setContent(Loc);
                    infowindow.open(map, marker);

                });



            });
        }

    });
}
Posted
Updated 5-Aug-14 2:13am

1 solution

Add .js latest version when move to 2013 to 2010
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900