Jquery.ajax没有在visual studio 2010上工作 [英] Jquery.ajax not working on visual studio 2010
问题描述
我正在阅读xmlfile并使用jquery ajax在谷歌地图上绘图.....使用此功能它在视觉工作室2013上运行得很好但是当我搬到Visual Studio 2010时
来自$ .ajax的部分不起作用...我在标题帮助中包含了jquery jquery-1.4.1.js ....
< pre lang =Javascript> function myFunction(){
alert(' 你好'跨度>);
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: 位置\\ + fname + ,
dataType: xml,
成功: function (xml){
$(xml).find( 位置)。each( function (){
Loc = $( this )。find( Loc_Name)。text();
Lat = $( this )。find( 纬度)。text();
Long = $( this )。find( 经度)。text();
var loc = new google.maps.LatLng(Lat,Long);
map.setCenter(loc);
var marker = new google.maps.Marker({
位置: new google.maps.LatLng(Lat,Long),
map:map,
title:' 我的工作场所',
图标:' http://google-maps-icons.googlecode.com/files/factory.png'
});
google.maps.event.addListener(marker,' click', function (){
infowindow.setContent(Loc);
infowindow.open(map,marker);
});
});
}
});
}
.ajax不起作用...我已经包含了jquery jquery-1.4标题帮助.1.js ....
功能 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,
成功: function (xml) {
(xml).find( 位置) .each( function (){
Loc =
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....
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);
});
});
}
});
}
解决方案 .ajax doesn't work ...i've included jquery jquery-1.4.1.js at the header help....
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 =
这篇关于Jquery.ajax没有在visual studio 2010上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!