Url实例

Methods

Properties

Events

Defined in: src\BM.Url.js:14
Module: BM

Constructor

Url

Url
(
  • [url=window.location.href]
)

Defined in src\BM.Url.js:14

Parameters:

nametypeflagdescription
[url=window.location.href] String optional

url字符串,默认为当前请求URL

Example:

var url = BM.Url();
var urlBeyondbit = BM.Url("http://www.beyondbit.com/");

Methods

appendKey

appendKey
(
  • key
  • value
)
String

Defined in src\BM.Url.js:74

追加一个键值,返回追加完后的URL

Parameters:

nametypeflagdescription
key String

增加的键

value String

增加的值

Returns:

String:

back

back () public static

Defined in src\BM.Url.js:114

返回到上一页

Example:

BM.Url.back();

back

back ()

Defined in src\BM.Url.js:129

返回到上一页并刷新

queryString

queryString
(
  • key
)

Defined in src\BM.Url.js:42

获取Url中的键值

Parameters:

nametypeflagdescription
key String

换取Url中请求的键名

Example:

var url = new Beyondbit.Url("http://www.baidu.com/?id=1&key=2");
var value = url.queryString("key");

redirect

redirect
(
  • url
)
public static

Defined in src\BM.Url.js:157

跳转页面

Parameters:

nametypeflagdescription
url String

要跳转的Url

Example:

BM.Url.redirect("http://www.beyondbit.com");

refresh

refresh () public static

Defined in src\BM.Url.js:143

刷新当前页面

Example:

BM.Url.refresh();

removeKey

removeKey
(
  • key
)
String

Defined in src\BM.Url.js:59

移除一个键值, 返回删除后的Url

Parameters:

nametypeflagdescription
key String

要移除的键

Returns:

String:

Properties

current

Unknown public static

Defined in src\BM.Url.js:102

获取当前Url对象

Example:

var currentUrl = BM.Url.current;

request

JSON

Defined in src\BM.Url.js:34

获取Url中所有请求的键值对集合

Top