URLから値を取得javascript - カスタムURLパターン
;私が欲しいもの
は
それはJavaScriptを使用して可能です..私はこのURL別にapp_id & dash_id
をしたい
var pattern_url = HTTP://my_host.com/account/apps/<int:app_id>/dashboard/<int:dash_id> ;
のですか?
URLから値を取得javascript - カスタムURLパターン
;私が欲しいもの
は
それはJavaScriptを使用して可能です..私はこのURL別にapp_id & dash_id
をしたい
var pattern_url = HTTP://my_host.com/account/apps/<int:app_id>/dashboard/<int:dash_id> ;
のですか?
この
var acutal_url = "HTTP://my_host.com/account/apps/6/dashboard/6"
var app_id = acutal_url.substring(acutal_url.indexOf("/apps/") + 6, acutal_url.indexOf("/dashboard/"));
var dash_id = acutal_url.substring(acutal_url.indexOf("/dashboard/") + 11);
alert(app_id);
alert(dash_id);
を試してみてくださいあなたは正規表現を使用する必要がありますが、念のためにあなたがあなたのためにそれを行うためのツールが欲しい、http://txt2re.com/
大感謝をしてみてください!できます ...! –