0

したがって、このJavaScript関数getSearchVariableがあります。これは、基本的に、生のJavascriptを使用してURLから変数を取得します。

変数の前と変数の後に静的テキストを含むURLを含むページにユーザーをリダイレクトする必要があります。

document.location.href="http://example.com/tracer?="+(getSearchVariable('Track')+"&tba=N"

上記のコードのようなものが機能しない理由について何か考えはありますか?

4

2 に答える 2

3

括弧のバランスが取れていません。

document.location.href=
    "http://example.com/tracer?="+(getSearchVariable('Track')+"&tba=N"
//                                ^
//                                |
//                                +--- Remove this guy.
于 2012-11-08T00:40:17.783 に答える
2

あなたが欠けているので)

document.location.href="http://example.com/tracer?="+(getSearchVariable('Track')+"&tba=N"
                                                     ^1                ^2      ^2

そのはず

document.location.href="http://example.com/tracer?="+(getSearchVariable('Track'))+"&tba=N"
于 2012-11-08T00:41:26.317 に答える