0

次のようなページ URL で:

http:mysite.com/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=3&cntnt01returnid=15

location.href を使用すると返されます

http://mysite.com/index.php?mact=News,cntnt01,detail,0

を含む完全な URL を取得する方法はありますか'...&cntnt01articleid=3&cntnt01returnid=15'

ありがとう

アンリ

4

1 に答える 1

2

URL が適切にフォーマットされていれば、クエリ文字列はwindow.location.href.

http://en.wikipedia.org/wiki/Percent-encoding

コンマは URI の予約文字であり、クエリ文字列値の一部として使用しないでください。また、URL を URI エンコードする必要があります。これは、encodeURIを呼び出すことによって JavaScript で行われます。

関連: URL にコンマを使用できますか?

于 2012-06-18T17:23:58.807 に答える