开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜