我有一个XML,它通过XSLT转换为HTML.XML能够包含JavaScript,并且它可以正确地将其转换为HTML,就像我在许多其他页面中一样.它只是不适用于GoogleMaps,我怀疑,我的JavaScript在某处出错了.
生成的HTML的相关部分看起来如下所示.
HTML /脚本中发生了什么:
<body
onload="start();">.google.maps.对我来说,这看起来像以下是错误的某个地方.
var map_options = {
center: new google.maps.LatLng(44.54, -78.54),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
Run Code Online (Sandbox Code Playgroud)
但几个小时后,我仍然无法弄清楚它是什么.
<html>
<head>
...
<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript">
</script>
<script type="text/javascript">
function start()
{
var map_canvas = document.getElementById('map_canvas');
// If the element can be located, we make it green. Checked.
// If we give the function another name than start, it won't be …Run Code Online (Sandbox Code Playgroud)