我有以下代码:
/* Set registered Cookie to TRUE if uri is /registrationSuccess */
var path = document.location.pathname.toLowerCase();
var re = new RegExp("/registrationSuccess","i");
if (re.test(path )) {
$.cookie("fpsRegistered", "true", { path: '/'});
}
/* End of cookie reg */
此行导致IE错误'对象不支持此属性或方法'
var path = document.location.pathname.toLowerCase();
有人可以帮忙吗?
答案 0 :(得分:0)
查看document
对象的the documentation,没有“location”属性,但有一个url
属性,所以你应该编码:
var path = document.url.toLowerCase();