mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine the index. refine the parse_query_string, add user_query object to result
This commit is contained in:
parent
c51842aa9a
commit
5cec967931
10 changed files with 28 additions and 12 deletions
|
@ -17,6 +17,7 @@ function padding(number, length, prefix) {
|
|||
function parse_query_string(){
|
||||
var obj = {};
|
||||
|
||||
// add the uri object.
|
||||
// parse the host(hostname:http_port), pathname(dir/filename)
|
||||
obj.host = window.location.host;
|
||||
obj.hostname = window.location.hostname;
|
||||
|
@ -30,6 +31,9 @@ function parse_query_string(){
|
|||
obj.filename = obj.pathname.substr(obj.pathname.lastIndexOf("/"));
|
||||
}
|
||||
|
||||
// pure user query object.
|
||||
obj.user_query = {};
|
||||
|
||||
// parse the query string.
|
||||
var query_string = String(window.location.search).replace(" ", "").split("?")[1];
|
||||
if(query_string == undefined){
|
||||
|
@ -40,6 +44,7 @@ function parse_query_string(){
|
|||
$(queries).each(function(){
|
||||
var query = this.split("=");
|
||||
obj[query[0]] = query[1];
|
||||
obj.user_query[query[0]] = query[1];
|
||||
});
|
||||
|
||||
return obj;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue