One difference between AngularJS' $location and window.location
Recenently, I encountered a problem.
Client side code is:
$http({
url: "/api/runtimelicense"
, method: "GET"
})
.success(function (data) {
window.location('#/search');
})
.error(function () {
});
Server side code is:
DbContext_context = GetContext(); // Just get dbcontexnt.
_context.MyDBSet.Where(s => s.ID == myID).ToList(); // When this request is from IE,it always throw exception with message "The connection was not closed. The connection's current state is open."; but if this request is from Chrome, all are ok.
At beginning, I felt very strange, as I know, browser should not impact server side by the same http request. I open Fiddler to see, there is an AngularJs digest error in IE, this error causes another request, it means there are two same http request to submit. I googled this question, but got nothing. I just repalce "window.location('#/search');" with "$location.path('/search');" , this issue is solved. Now, I still cannot know the details clearly. So, remain 2 questions:
1) Why does IE Angular digest exception?
2) Why does exception can cause another request?
One difference between AngularJS' $location and window.location的更多相关文章
- window.location.href = window.location.href 跳转无反应 a 超链接 onclick 点击跳转无反应
错误写法 , 主要是在 href="#"这里 <a href="#" id="send" onclick="return b ...
- window.location.href = window.location.href window.location.reload()
w 0-会议预订提交了预订日期,预订成功后默认显示仅显示当前日期的新页面若显示预定日的信息,则可以对预定日存入cookie: http://stackoverflow.com/questions/24 ...
- window.location和window.location.href和document.location的关系
1,首先来区分window.location和window.location.href. window.location.href是一个字符串. 而window.location是一个对象,包含属性有 ...
- JS中 window.location 与window.location.href的区别
疑惑:window.location='url' 与window.lcoation.href='url'效果一样,都会跳转到新页面,区别在哪?查得的资料如下: 1:window.location是页 ...
- js 刷新页面window.location.reload();
Javascript刷新页面的几种方法:1 history.go(0)2 window.location.reload() window.location.reload(true) 3 ...
- window.top.location.href 和 window.location.href 的区别
"window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...
- window.location事件
一.最外层top跳转页面,适合用于iframe框架集 top.window.location.href("${pageContext.request.contextPath}/Login_g ...
- 解决微信浏览器无法使用window.location.reload()刷新页面
解决方法: 使用 window.location.href=window.location.href+随机数 代替 window.location.reload(). function r ...
- javascript宿主对象之window.location
location属性是一个用来存储当前页面URL信息的对象. 下面我们通过循环来列出location对象的完整属性列表: for(var i in location){ if(typeof locat ...
随机推荐
- STL六大组件
1.容器 顺序容器.关联容器 2.算法 各种常用算法,sort.search.copy…… 3.迭代器 用来索引容器中元素,是容器与算法之间的胶合剂 4.仿函数(另名函数对象) 仿函数就是让一个类的使 ...
- Linux系统下修改环境变量PATH路径
方法一: PATH=$PATH:/etc/apache/bin 该方法只对当前会话有效,每次注销或者拿出系统,该设置就会无效 方法二: vi /etc/profile 在适当的位置写入:PATH=$P ...
- UVa 10163 Storage Keepers (二分 + DP)
题意:有n个仓库,m个管理员,每个管理员有一个能力值P,每个仓库只能由一个管理员看管,但是每个管理员可以看管k个仓库(但是这个仓库分配到的安全值只有p/k,k=0,1,...),雇用的管理员的工资即为 ...
- BZOJ 4765 普通计算姬 (分块 + BIT)
4765: 普通计算姬 Time Limit: 30 Sec Memory Limit: 256 MBSubmit: 1547 Solved: 329[Submit][Status][Discus ...
- 在IIS7.5下配置PHP环境
1.下载安装ZkeysPHP,路径随意 找到该程序集 D:\ZkeysSoft\Php\php5isapi.dll 2.在站点配置“处理程序映射”,添加php后缀映射由D:\ZkeysSoft\Php ...
- python基础回顾
1.第二个缺点就是代码不能加密.如果要发布你的Python程序,实际上就是发布源代码,这一点跟C语言不同,C语言不用发布源代码,只需要把编译后的机器码(也就是你在Windows 上常见的xxx.exe ...
- virtualbox centos 连接网络
一.设置网络 设置 -> 网络 -> 连接方式:桥接网卡.设置当前连网络的界面名称.接入网线打勾 二.开启eth0 vi /etc/sysconfig/network-scripts/if ...
- 有趣的CSS3背景 斜条纹
今天逛的时候发现了一个有趣的css3实现的背景效果,代码实现 .noaccess { position: absolute; width: 300px; height: 100px; z-index: ...
- Objective-C:01简介
1.Objective-C简介 Objective-C是一种面向对象的计算机语言 OC不是一门全新的语言 C语言的基础上增加了一层最小的面向对象语法 OC完全兼容C语言 可以在OC代码中混入C语言代码 ...
- 2.Java面向对象编程三大特性之继承
在<Think in Java>中有这样一句话:复用代码是java众多引人注目的功能之一.但要想成为极具革命性的语言,仅仅能够复用代码并对其加以改变是不够的,他还必须能够做更多的事情.复用 ...