indexOf()使用出错 thisUrl = window.location.href; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 thisUrl = window.location.href; window.location 是一个对象window.location.href 返回的才是当前网页的链接字符串 将location对象转化为它的字符串形式thisUrl = window.location; => thisUrl = window.location.toString(); thisUrl = window.location.href; ?是对象?为什么alert(window.location);不显示 [object] 而显示路径信息?或者说我们经常window.location='http://url';。这样写是不严谨的做法? 手册上说:location.href是location的默认属性 设置location='http://microsoft.com' 和设置location.href='http://microsoft.com'. 是相同的 不,window.location确实是对象,只是他的toString()方法会呈现出window.location.href值alert时对象会默认调用该对象的toString()方法,所以程序字符串而赋值时也会调用toString()方法的,即对其href属性赋值。确实不严谨,但dom约定俗成的东西简化倒也并非大问题,只要明白概念 thisUrl = window.location.toString()或者thisUrl = ""+window.location; thisUrl = window.location; 改成thisUrl = window.location.url;就OK啦^_^ Extjs grid设置单元格背景色 求助~~这个函数对吗? 为啥用不了 请问这种源码里面的单词变色时如何实现的呢?(有图) 关于json,java对象转换成json格式,怎么做? iframe 自适应 那位好心人可以帮我改一下这个flash图片切换的效果 /***高分请教:页面Textarea输入域中,为实现计算公式的输入,如何在当前焦点动态赋值,***/ js如何提取iframe中连接中的参数 javascript 函数传参问题? 颜色设置? 如何使按方向上、下键来代替Tab、shift+Tab键? 关于日期的迷惑
window.location.href 返回的才是当前网页的链接字符串
或者说我们经常window.location='http://url';。这样写是不严谨的做法?
location.href是location的默认属性
设置location='http://microsoft.com' 和设置
location.href='http://microsoft.com'.
是相同的
或者
thisUrl = ""+window.location;