頁面跳轉

1.url

window.location.href="url";          //這行代碼的功能,就是實現頁面跳轉!    //這種方法,是最經常使用的頁面跳轉的方法!code


注:對象

a.window.location.href="url";  能夠簡寫爲 window.location="url";    get

b.由於location對象的默認屬性,就是href屬性!!!io



----------class

參考:方法

1.http://zhidao.baidu.com/link?url=spQ5AiJdD6yGfhY6oJOSUnFrZdhjWWEeC1EYPaS4aaZXJUu9Ue-HywRL90OrDZNW8FvNTib8fU_-1A2CeHnIeqco

window.location是頁面的位置對象,window.location.href是 location的一個屬性值,而且它是location的默認屬性就是說對window.location直接賦值一個url實際上就是對window.location.href賦值。location對象除了有href屬性外還有不少其餘屬性和方法
相關文章
相關標籤/搜索