Microsoft EDGE使用typescript文件报告XHR HTTP404(Microsoft EDGE reports XHR HTTP404 with typescript file)
当我从Visual Studio 2015调试Typescript Web应用程序时,使用Microsoft EDGE浏览器报告以下内容;
HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier). (XHR): GET - http://localhost:2543/scripts/Helpers/jsontable.ts
我的项目中有一个
jsontable.ts
文件,但它jsontable.ts
scripts
下。 我还在我的解决方案中进行了全文搜索,并且除了在_references.ts
文件中之外我还没有找到对'jsontable.ts'的其他引用。 问题仍然存在。 其他浏览器不会在F12网络窗格中报告此错误(使用Internet Explorer 11,Chrome,Opera和FireFox进行测试)。 我知道我不会在我的申请中自己从其他州发送此请求。 有没有其他人经历过这个。 有什么问题吗?When I debug a Typescript web-application from Visual Studio 2015, using the Microsoft EDGE browser it reports the following;
HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier). (XHR): GET - http://localhost:2543/scripts/Helpers/jsontable.ts
I have a
jsontable.ts
file in my project, but it is NOT located underscripts
. I have also done a full text-search in my solution, and haven't found other references to 'jsontable.ts' other than in the_references.ts
file which I have now removed. The problem is still there. Other browsers doesn't report this error in the F12 network-pane (tested with Internet Explorer 11, Chrome, Opera and FireFox). I know for sure I don't send this request myself from other states in my application. Has anyone else experienced this. Is there any fix?
原文:https://stackoverflow.com/questions/34244816
满意答案
所以我最终放弃了Bing,并使用了GoogleMaps。 说实话,第一次尝试就像魅力一样! 使用Microsoft工具太多了......
无论如何...
首先是在index.html中加载gogle API:
<script src="http://maps.googleapis.com/maps/api/js"></script>
然后,在控制器中,在容器中添加GoogleMaps API(如果需要,还可以将引脚添加到中心:
var tmpMap = new google.maps.Map(document.getElementById('myContainer'), { center: { lat: parseFloat($scope.lat), lng: parseFloat($scope.long) }, zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }); var tmpMarker = new window.google.maps.Marker({ position: tmpMap.getCenter(), map: tmpMap, title: 'My Title' });
然后,设置容器的大小(与BingMaps相反,Google不会调整容器的大小..所以没有大小,你将无法看到任何东西)
最后,将CSP设置为接受来自googleapi.com/*的代码。在此示例中,Il打开了所有内容的CSP,这对真正的应用程序来说不是一件好事:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src *">
瞧!
谷歌是爱,谷歌是生命:)
So I finaly gave up on Bing, and used GoogleMaps instead. And to be honest, it works like charm on the first try ! So much for using Microsoft tools...
Anyway...
First is to load the gogle API in the index.html :
<script src="http://maps.googleapis.com/maps/api/js"></script>
Then, in the controller, add the GoogleMaps API in the container (and adding a pin to the center if needed :
var tmpMap = new google.maps.Map(document.getElementById('myContainer'), { center: { lat: parseFloat($scope.lat), lng: parseFloat($scope.long) }, zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP }); var tmpMarker = new window.google.maps.Marker({ position: tmpMap.getCenter(), map: tmpMap, title: 'My Title' });
Then, setting a size to the container (contrary to BingMaps, Google doesn't resize the container.. So without a size, you won't be able to see anything)
Finaly, set the CSP to accept code from googleapi.com/* In this sample, Il opened the CSP to everything, which is not a good thing to do on a real app :
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src *">
And voilà !
Google is love, Google is life :)
相关问答
更多允许Web套接字的content-security-policy元标记(content-security-policy meta tag for allowing web socket)
内容安全政策cordova问题(Content Security Policy cordova problems)
Bing地图绘图工具模块(Bing Maps Drawing Tools Module)
Bing语音和Bing地图在Windows 8商店应用中存在冲突(Bing Speech and Bing Maps conflicting in Windows 8 Store app)
使用Bing映射和Bootstrap(Using Bing maps with Bootstrap)
“找不到内容安全策略元标记”(“No Content-Security-Policy meta tag found”)
内容 - 安全 - 政策问题(Content-Security-Policy issue)
让bing地图全部铺设(Make bing maps streetch all the may)
在Phonegap / cordova Android APP中使用内容安全策略连接REST API的正确方法是什么(What is the right way of connect to a REST API with content security policy in a Phonegap/cordova Android APP)
Cordova + Bing地图+内容安全政策(Cordova + Bing Maps + Content Security Policy)
相关文章
更多Interviewing at Microsoft
摘抄---Multimedia Streaming on Microsoft Windows CE 3.0
Hadoop——Microsoft大数据战略的核心
Java 流(Stream)、文件(File)和IO
《微软Windows 8新特性和功能教程》(VTC.com Microsoft Windows 8 Introduction Course)[光盘镜像]
PHP 中dirname(_file_)
【HDFS】HADOOP DISTRIBUTED FILE SYSTEM
shell 脚本执行,出现错误bad interpreter: No such file or directory
Hadoop HDFS Wrong FS: hdfs:/ expected file:///
My W3C Custom Mapping File
最新问答
更多如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
linux的常用命令干什么用的
由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
如何交换返回集中的行?(How to swap rows in a return set?)
在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
Java中的不可变类(Immutable class in Java)
WordPress发布查询(WordPress post query)
如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!