私はこのコードを持っています、
<a href="#" id="addtoteam">
Add to Team
</a>
、このリンクをクリックすると、モーダル ダイアログが表示されます。
$('#addtoteam').click(function(){
var url = '<?php echo BASEURL;?>';
$( "#dialogbox" ).dialog({
autoOpen: true,
buttons: {
"Use Registration Credits": function(){
// execute something here before redirecting it to another page, perhaps perform the updating of the registration_credits of each team here
window.location = url + '/administration/add_to_team/' + teamID +'/'+ playerID +'/?credit=1';
},
"Pay Extra Charge": function() { $(this).dialog("close"); },
"Cancel": function() { $(this).dialog("close"); }
},
width: 800
});
});
ご覧のとおり、3 つのボタンがあります。[Use Registration Credits] ボタンを見てください。これを選択すると、別のページにリダイレクトされますが、別のページにリダイレクトされる場合は、このようなURL、
sample.com/administration/add_to_team/team_id/player_id?credit=1
click()
今私の質問は、この値が私の team_id またはプレーヤー ID になるように、関数内の変数に割り当てることができる値を渡すことは可能ですか? 私が明確に説明したことを願っています。ありがとう。