重複の可能性:
jQueryでURLパラメーターを取得する
このURLをブラウザで取得しました
http://docs.google.com?k=account&cs=This%20Site&u=https%3A%2F%2Faccess.dev.google.com
u paramterにhttpまたはhttps://access.dev.google.comがあるかどうかを確認してから、何らかのアクションを実行する必要があります。
重複の可能性:
jQueryでURLパラメーターを取得する
このURLをブラウザで取得しました
http://docs.google.com?k=account&cs=This%20Site&u=https%3A%2F%2Faccess.dev.google.com
u paramterにhttpまたはhttps://access.dev.google.comがあるかどうかを確認してから、何らかのアクションを実行する必要があります。
になり得る:
var hr = 'http://docs.google.com?k=account&cs=This%20Site&u=http%3A%2F%2Faccess.dev.google.com'; //window.location.href;
var res = hr.match(/u=(http|https)%3A%2F%2Faccess.dev.google.com/g);
if(res != null) alert('ok');
else alert('not found');
jensgram のコメントをご覧ください。/u= は次のようになります: [?&]u=
これは素敵な非正規表現バージョンです。
var path = window.location.pathname;
//assuming you want the path for http://docs.google.com?k=account&cs=This%20Site&u=https%3A%2F%2Faccess.dev.google.com
if(path.substring(path.indexOf('u=')+2, path.indexOf('u=')+7) == 'https') {
//execute if https, or change to +2, +6 for http
}
それがあなたが探しているものかどうかはわかりませんが、試してみる価値はありました。