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啦^_^ jquery获取表格中当前文本的value值 问一个jq的正则提取字符问题 探讨网页编程中最难的一门语言。。。。。。 如何写正则表达式匹配html标签 jquery dialog 被flash遮注,求firefox以及ie8,ie6的解决办法 散分,大家把该结的帖子都结了吧 数据库数据与静态数据匹配select问题 请问关于时间的问题,马上揭贴 大家帮忙看一下 调用js的这个函数为什么不出来 请教用js怎么编写实现用word打开服务器所在主机的某一目录下的word文件 如何使按方向上、下键来代替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;