我想知道为什么我收到错误消息 (Uncaught TypeError: number is not a function) ,这是我的代码:
<script type = "text/javascript">
function dataparse(points)
{
points = points.substr(0, points.length - 1);
var linar = points.split("\n");
// Break each point by line break
var wrkar = [];
var pntar = [];
for (var i = 0; i < linar.length; i++)
{
wrkar = linar[i].split(",", 2);
// Break each point into x and y
pntar.push(new google.maps.LatLng(parseFloat(wrkar[0]), parseFloat(wrkar[1])));
}
return pntar;
}
var cd = [
(30.40545181622765, -9.582610613708539)
(30.405229737948233, -9.577975756530805)
(30.40300892737293, -9.577546603088422)
(30.402268645956614, -9.584241396789594)
];
var df = dataparse(cd);
alert('df');