window.location在IE中路径问题
来源:互联网 发布:艺恩数据 电视剧网播 编辑:程序博客网 时间:2024/06/05 11:54
如果在jsp的head中指定了basepath,如下,则表示客户端路径以basepath所指定的路径为相对地址开始寻址。但是使用window.location时,在IE浏览器中不识别basepath,此时window.location是以本js页面为相对路径的,此处推荐使用绝对路径,在火狐等浏览器中识别basepath。
当css中引用url时,在使用了basepath、不区分浏览器的的情况下,如果css代码在jsp文件中,则url的相对路径以basepath开始,如果css代码在css文件中,则url以当前css为相对路径。
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><%=basePath %><html><head> <base href="<%=basePath%>"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Insert title here</title><script type="text/javascript" src="model1/js/submit.js"></script> <link rel="stylesheet" type="text/css" href="model1/css/submit.css"></head>
0 0
- window.location在IE中路径问题
- js用 window.location.href跳转IE和chrome中路径url不一致问题
- 关于window.location.reload在IE浏览器中不刷新的问题
- window.location.href在IE下失效的问题
- window.location.replace 在ie下不起作用
- window.location.href IE下无效问题
- JavaScript window.location IE谷歌跳转路径不兼容
- springMVC框架在js中使用window.location.href请求url时IE不兼容问题解决
- window.location.href 在IE不跳转的解决方法
- IE中使用window.location时会忽略base href值
- js中window.location失效问题
- 解决IE6中javascript在window.location.href不工作的问题
- 解决在表单中,window.location.herf无法跳转的问题
- 微信开发时 在页面中 window.location.href 不可用问题
- window.location.href问题
- 解决nginx在windows环境下location中root路径空格问题
- Ext.window.Window在IE有部分半透明的问题
- window.location.href在firefox中不兼容的解决办法
- html中rem布局后,在背景图片压缩后,根据压缩比例计算代码
- VMware中linux系统的网络设置
- 图像聚类-谱聚类
- 字符数组与字符指针数组的区别
- [个人博客搬运]JavaEE自定义标签技术
- window.location在IE中路径问题
- 对一些指针数组的理解
- 【LeetCode】Container With Most Water 解题报告
- GPU开发环境
- Storm JAVA_HOME is incorrectly set
- Android 任务管理器分析小结
- 面试需要问到的11点
- Java—BIO (Block IO)
- Linux 技巧:让进程在后台可靠运行的几种方法