简体   繁体   English

添加特定于Windows Phone Internet Explorer的代码

[英]Adding code specific to Windows Phone Internet Explorer

I've been testing out the Google Maps API on various browsers and also different phones/tablets... all is working fine except for when trying it on a Windows Phone. 我已经在各种浏览器以及不同的手机/平板电脑上测试过Google Maps API,除了在Windows Phone上尝试使用时,所有功能都工作正常。 After some research I've found out it's because Google Maps isn't supported on Windows Phones hence the error. 经过一些研究,我发现这是因为Windows Phones不支持Google Maps,因此出现了错误。

My question is how would I go about making it so that it displays an image of the map instead of the map API? 我的问题是我将如何制作它,以使其显示地图图像而不是地图API?

eg. 例如。 for Windows Phone it would display: 对于Windows Phone,它将显示:

 <div><img src="map.png"></div> 

But for everything else it would display and use the API: 但对于其他所有内容,它将显示并使用API​​:

 <div id="map_canvas"></div> 

Many thanks for your help 非常感谢您的帮助

You can check the user agent for IEMobile 您可以检查IEMobile的用户代理

This is the windows phone mobile agent. 这是Windows Phone移动代理。

Or better yet can you not do a boolean check if the map is working so if it fails in any browser then you are covered? 或更妙的是,您是否可以不对布尔值进行布尔检查,以确保该图在任何浏览器中均无法正常运行,那么您会被覆盖吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Internet Explorer + Windows Phone IEMobile条件注释 - Internet Explorer + Windows Phone IEMobile Conditional Comments 如何在 Windows Phone 7 上调试 Internet Explorer? - How do I debug Internet Explorer on Windows Phone 7? Windows Phone Internet Explorer Mobile 7浏览器是否支持触摸事件? - Does the Windows Phone Internet Explorer Mobile 7 browser support touch events? 如何区分Internet Explorer 10 / Windows Phone 8中的单击和触摸事件 - How to distinguish click and touch events in Internet Explorer 10 / Windows Phone 8 在某些情况下,例如特定于Internet Explorer的CSS或特定于Internet Explorer的JavaScript代码,如何仅将Internet Explorer 10定位? - How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code? 如何在Windows Phone 8 OS的诺基亚Lumina 92​​5中的Internet Explorer中禁用Java脚本? - How to disable java script in internet explorer in nokia lumia 925 in windows phone 8 os? 无法单击Windows Phone 8.1 Internet Explorer上的动态加载的单选按钮 - Can't click dynamically loaded radio button on Windows Phone 8.1 Internet Explorer Ajax:将代码注入Internet Explorer - Ajax: injecting code into Internet Explorer jQuery代码在Internet Explorer中不起作用 - jQuery code not working in Internet Explorer 此代码在Chrome中有效,但在Internet Explorer中不起作用 - This code works in Chrome but not in internet explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM