|
查看: 945|回复: 4
|
加了Google Map 其他Java Script 无法执行
[复制链接]
|
|
|
加了Google Map 为什么其他Java Script 无法执行, 既unlike 无法执行
<script src="http://ditu.google.cn/maps?file=api&v=2&key=abcdefg&sensor=true_or_false"
type="text/javascript"></script>
<script type="text/javascript">
function unlike()
{
alert('');
}
function initialize() {
if (GBrowserIsCompatible()) {
var map= new GMap2(document.getElementById("map_canvas"));
// map.setCenter(new GLatLng(39.9493, 116.3975), 12);
map.setCenter(new GLatLng(<?php echo $re[x]; ?>, <?php echo $re[y]; ?>), 15);
}
}
</script> |
|
|
|
|
|
|
|
|
|
|
发表于 18-4-2011 03:27 PM
|
显示全部楼层
|
其实你给的code只是declare function unlike罢了,并没有执行unlike咯。。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 18-4-2011 09:23 PM
|
显示全部楼层
<body>
<button type="button" onclick=unlike('x')>Unlike</button>
</body>
在body 我加了以上段执行, 当并没成功执行 |
|
|
|
|
|
|
|
|
|
|
发表于 19-4-2011 12:17 AM
|
显示全部楼层
|
老实说,你post出来的code都不完整,很难对症下药咯。你不妨试下debug你的code看看。你用IE的是吗?如果是IE6或7,可以安装IE developer toolbar。IE8和IE9已经build in了。如果你用firefox,可以安装firebug。google chrome的话,本身就有developer tools了。用以上的工具来debug你的code,应该不难发现出了什么问题。 |
|
|
|
|
|
|
|
|
|
|
发表于 19-4-2011 05:47 PM
|
显示全部楼层
本帖最后由 Reader 于 19-4-2011 05:53 PM 编辑
- <script src="http://ditu.google.cn/maps?file=api&v=2&key=abcdefg&sensor=true_or_false"
- type="text/javascript"></script>
- <script >
- function unlike(x)
- {
- alert(x);
- }
- function initialize() {
- if (GBrowserIsCompatible()) {
- var map= new GMap2(document.getElementById("map_canvas"));
- map.setCenter(new GLatLng(39.9493, 116.3975), 12);
- // map.setCenter(new GLatLng(<?php echo $re[x]; ?>, <?php echo $re[y]; ?>), 15);
- }
- }
- </script>
- </head>
- <body>
- <input type="button" onclick="javascript:unlike('x');" value="unlike"/>
- </body>
- </html>
复制代码 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|