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 ...
随机推荐
- 重启服务器后,启动oracle监听报错 The listener supports no services The command completed successfuslly
启动监听报错如下图所示: 远程连接报错如下图所示: 问题原因:数据库实例没注册到listener中 解决方法: (1)登录数据库:$sqlplus / as sysdba (2)显示服务名:sql& ...
- 第01章:MongoDB简介
①MongoDB是什么 MongoDB是一个使用C++编写的.开源的.面向文档的NoSQL(Not Only SQL)数据库,也是当前最热门的NoSql数据库之一. ②MongoDB特点 1.高性能. ...
- JavaBase
第一章: Java之父:詹姆斯.高斯林:1995年5月推出Java: java分为 java se : 基础版本(标准版) Java EE : 企业级开发 ME:嵌入式开发(已被安卓替代) ...
- 防火墙内JVisualVM连接jstatd解决方案
jstatd启动后会打开两个端口,其中一个端口可通过参数“-p”指定,如果不指定默认为1099,另一个是一个随机端口,不能参数指定: # netstat -lpnt|grep jstatd tcp ...
- day18(javaEE三大组件之一servlet(简介(一)))
Servlet servlet是小型服务器语言,使用它可以处理前台传递来的信息,servlet进行处理后在响应给前台,其中servlet起到了关键性的作用.前端输入的信息可以持久化的存储在数据库中,并 ...
- CentOS 5 上配置 Redmine 和 Git
现在我们用 Trac + Git 来管理所有的项目,早些时候是由 Trac + Subversion 管理的,和 Git 比较起来 Subversion 简直就是龟速.虽然我们前段时间换成了 Git ...
- kepware http接口 java语言开发
读取某变量的值(OK HTTP OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .u ...
- spring-mvc源码阅读笔记
简要的做一些spring-mvc部分的源码学习笔记 Spring-mvc做的工作主要是俩大方面吧:一个是初始化一个ioc容器,一个是mvc部分的控制和视图模块的实现. 先说下ioc容器的初始化部分:i ...
- ZUFE2480: 神奇的序列 2017-05-12 16:45 39人阅读 评论(0) 收藏
2480: 神奇的序列 时间限制: 4 Sec 内存限制: 256 MB 提交: 31 解决: 15 [提交][状态][讨论版] 题目描述 序列a如下: a[0] = A; a[1] = B; a ...
- springMVC:HandlerInterceptor拦截器的使用
1.使用背景 Web项目中需要判断http接口用户Post上来的数据是否合法,如果不合法要另做处理,用户Post上来的数据是Json形式的,我们用了@RequestBody标记自动将json形式的提交 ...