【发布时间】:2014-06-08 14:34:16
【问题描述】:
我正在为大学做一个项目,这个项目是一个 Web 应用程序 Mashup,它必须包含 2 个 API,我正在使用“StatsFc”和“Google Maps”API,这两个 API 都非常容易理解和使用除了我遇到的一个问题。
为了输入特定足球队的下一场比赛赛程,他们告诉您使用此代码:
<!-- Place in the <head> of your page -->
<script src="//code.jquery.com/jquery-latest.min.js"></script>
<link rel="stylesheet" href="//api.statsfc.com/widget/next-fixture.css">
<script src="//api.statsfc.com/widget/next-fixture-1.0.min.js"></script>
<!-- Place in the <body> of your page -->
<div id="statsfc-next-fixture"></div>
<!-- Place just before the closing </body> tag -->
<script>
var nextFixture = new StatsFC_NextFixture('API_KEY');
nextFixture.team = 'Liverpool';
nextFixture.display('statsfc-next-fixture');
</script>
我已经遵循了这一点,并且它在页面上的任何 div 中都能完美运行,除了我在谷歌地图信息窗口中的那个:
这是地图部分,现在运行代码时会显示但 API 信息没有输入到 div 中
function initialize() {
var myLatlng = new google.maps.LatLng(53.4302988,-2.9616045);
var mapOptions = {
zoom: 4,
center: myLatlng
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var contentString = '<div id="siteNotice">'+
'<div id="statsfc-next-fixture">'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
我不太了解这一点,所以我为我的错误解释提前道歉,我也不知道这是否可行,所以请提供帮助或信息将不胜感激。如果还有什么问题可以问,非常感谢
詹姆斯
【问题讨论】:
标签: javascript php jquery api google-maps-api-3