我在尝试显示 googlemaps 时遇到错误
如果我加载 googlemaps javascript 源
我在 Firebug 中得到这个错误
syntax error
[Break on this error] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\nmaps?fil...sor=false (regel 1)
我有这个来加载文件
<?php if (isset($gmap))?><script type="text/javascript" src="<?php echo __PUBLIEK_PAD; ?>/js/<?php echo $gmap; ?>"></script>
这是我如何设置变量
$key='my-api-key';
$this->view->gmap="http://maps.google.com/maps?file=api&v=2&key=".$key."&sensor=false";
$this->view->js_gmaptest = 'gmaptest.js';
这里有什么东西会导致问题吗? 我以前让它工作过,但我知道我不再知道了。
谢谢,理查德
最佳答案
不确定是否是问题所在,但 documentation说你的文件的开头应该是这样的:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
关于php - googlemaps 文档类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2127601/