我在 phpdesigner 中, 一个php文档中的class中, 加入了一个函数,
document.getElementById 那句显示 syntax error , unexpected '=' , 这是什么问题呢?function cb_showLocation($result) {
// 显示结果
if (result.Status.code == G_GEO_SUCCESS)
{
document.getElementById("divOutput").innerHTML = '<form id=\"2beSelected\" name = \"addrSel\" method=\"post\" action=\"\">'; // var lat, lng, point, address;
for ($i = 0; i < result.Place.length; i++) {
lat = result.Place[i].Point.coordinates[1]; // lat
lng = result.Place[i].Point.coordinates[0]; // lng
address = result.Place[i].address; // 地址
point = new GLatLng(lat, lng); document.getElementById("divOutput").innerHTML += "<input type=\"radio\" name=\"possible\" value=\"" + point.toString() + "\">" +address+ " <small>" + point.toString() + "</small></br>";
}
document.getElementById("divOutput").innerHTML += "<input type =\"button\" value =\"Submit\" onclick =\"addressSelected()\"></form>"; }
else {
document.getElementById("divOutput").innerHTML = result.Status.code;
}
}
document.getElementById 那句显示 syntax error , unexpected '=' , 这是什么问题呢?function cb_showLocation($result) {
// 显示结果
if (result.Status.code == G_GEO_SUCCESS)
{
document.getElementById("divOutput").innerHTML = '<form id=\"2beSelected\" name = \"addrSel\" method=\"post\" action=\"\">'; // var lat, lng, point, address;
for ($i = 0; i < result.Place.length; i++) {
lat = result.Place[i].Point.coordinates[1]; // lat
lng = result.Place[i].Point.coordinates[0]; // lng
address = result.Place[i].address; // 地址
point = new GLatLng(lat, lng); document.getElementById("divOutput").innerHTML += "<input type=\"radio\" name=\"possible\" value=\"" + point.toString() + "\">" +address+ " <small>" + point.toString() + "</small></br>";
}
document.getElementById("divOutput").innerHTML += "<input type =\"button\" value =\"Submit\" onclick =\"addressSelected()\"></form>"; }
else {
document.getElementById("divOutput").innerHTML = result.Status.code;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货