---
title: "location 介绍"
author: "lokvin"
date: "2009-09-11T10:57:19Z"
tags: []
slug: "location"
draft: false
lastmod: "2009-09-11T11:11:59Z"
id: 466748
url: "https://lokvin.iteye.com/blog/466748"
---

**location.search=path_from_questionmark**
location.search 是查询字符串。
eg.
http://www.w3schools.com/js/tryit.asp?filename=try_loc_search
location.search = ?filename=try_loc_search



**location.pathname=path**
The pathname property sets or returns the path of the current URL.
eg.
http://www.w3schools.com/js/tryit.asp?filename=try_loc_pathname
location.path = js/tryit.asp