我很难在另一堂课上上课.这是设置的一个示例:
的index.php
<?php
include("functions/userFunctions.php");
$user = new UserFunctions ();
$user->validate();
?>
Run Code Online (Sandbox Code Playgroud)
UserFunctions.php
<?php
include("../db/userDB.php");
class UserFunctions extends UserDB
{
public function GetHello(){
$this->DBHello();
}
}
?>
Run Code Online (Sandbox Code Playgroud)
UserDB.php
<?php
class UserDB
{
public function DBHello(){
return "Hello"
}
}
?>
Run Code Online (Sandbox Code Playgroud)
Chrome返回:HTTP错误500(内部服务器错误):服务器尝试完成请求时遇到意外情况.
这怎么可能不起作用?
当我在地理编码器功能之外提醒我的数组"markerArray"时,它说它未定义.
想不通为什么?有没有办法从函数外部的数组中获取值?
var markerArray = new Array();
for(var i in opts.markers)
{
address = opts.markers[i].address;
//alert(opts.markers[i].icon);
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ address: address }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map
});
}
}
markerArray[i] = marker;
});
}
alert(markerArray[0].position);
Run Code Online (Sandbox Code Playgroud)