How to append parameter to given url in javascript?
I want to append some value to given URL. Suppose var name = "ABC";
I want to append ABC to url say "http://www.mysite.com"
How to append name 开发者_如何转开发"ABC" to above url??
You normally use a query string for this kind of thing:
http://www.mysite.com?name=ABC
The part after the ? is called the query string or the "search".
You concatenate the search terms with "&", e.g.,
http://www.mysite.com?name=ABC&type=1&level=4
Not included is the "hash", delimited by the # character, which references a portion of the page and comes last. For exampe,
http://www.mysite.com?name=ABC#part1
精彩评论