Why didn't work my classic asp source code?

2019-09-20 10:56发布

When i run this code, nothing displayed, it shows blank. I checked inspector and network tab..

function storevaluestoSession()
{
    var somewhere=map.getCenter()
    map.setCenter(somewhere);
    var somewhere=String(somewhere)
    var nloc=somewhere.search(',');
    var location2=String(somewhere).substring(1,nloc);
    var sw2=String(somewhere);
    var lsw2=sw2.length-1;
    var lsw22=nloc+1;
    var location3=sw2.substring(lsw2,lsw22);
    var myLatLng = new google.maps.LatLng(location2,location3); 

    var lat2=ltrim(location2.toString());
    var lon2=ltrim(location3.toString());
    var CurrentpkFamily=<%=session("pkfamily")%>;

    var xmlhttp;
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET","sessionhelper.asp?lat="+lat2+"&lon="+lon2+"&CurrentpkFamily="+CurrentpkFamily, true);
    xmlhttp.send();
}

And i am new to asp, can anyone help?

Thanks,

1条回答
做个烂人
2楼-- · 2019-09-20 11:49

The response is in xmlhttp.responseXML. Add

  alert(xmlhttp.responseXML);

before the last } to see server response.

查看更多
登录 后发表回答