2012-11-02 22 views
0

有人可以帮我找出为什么IE9不会加载我的谷歌地图,但其余的主要浏览器会。我认为它与实际的设置或标题有关,而不是javascript,但让我知道你是否也想要。下面是代码:为什么只有Internet Explorer不会加载我的谷歌地图对象

<?php 
include('session.php'); 
?> 
<html> 
    <head> 
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
<title>Google Maps API Project</title> 
<script type="text/javascript" src="https://maps.googleapis.com/maps/api  /js?sensor=false"></script> 
<link rel="stylesheet" href="style.css" type="text/css" /> 
</head> 
    <body> 
    <h1>Title</h1> 
<div id="map" style="width: 1000px; height: 500px"></div> 
    <div id="message"></div> 

    <input type="text" id="search" > 
    <input type="button" onclick="search();" value="Search"> 
<input type="button" onclick="addlaunchMark();" value="Add Launch"> 
<input type="checkbox" id="launches" checked="checked" onchange="addRemovelaunch()"> 
</br> 
<input type="textbox" id="box1" style="display: none"> 
<input type="textbox" id="box2" style="display: none"> 

<script type="text/javascript"> 

</script> 
</body> 
+2

嗯..顺便说一句,你缺少上述 doctype声明? <!DOCTYPE html>也结束标记缺少..因为您的粘贴或其他东西的错误? –

+0

由于某种原因,我不认为你可以在PHP代码后声明。我做到了,它的工作原理非常感谢! – HondaKillrsx

+0

太棒了,我把它作为答案发布,以便您接受。 :) –

回答

2

问题是因为缺少造成的声明<!DOCTYPE html>,(该死IE):)

增加,因为它告诉浏览器哪种类型的html是 使用,这很重要在文件中。缺少DOCTYPE的文档将以 bugwards兼容模式呈现,因为它假定为在DOCTYPE广泛使用之前编写的较早的 文档。

Source

+0

你应该指导OP为什么有所作为。 – hakre

+0

编辑我的答案 –

+0

嘿哈克尔,你想停下来评分我所有的问题。我们中的一些人对编程不熟悉,并不知道所有的东西。这就是为什么论坛是创造。 – HondaKillrsx

相关问题