location.search を使用して、URLから ? 以降のパラメータを取得できます。

以下の例では、取得したプロトコルをアラート表示しています。

alert(location.search);