this is my function :
functiohtml(i18n.tr(html));
$("#rpps").focus();}
})
}
i want to use it here in my code instead of repeating myseld
function forgotten() {
if (force_mssa
so my question is how i replace it and get the right Url for each ?????????????
CodePudding user response:
At the first case you sould use mode=physician&panel=forgotten&force_mssante=0
,
at the second case you should use mode=physician&panel=forgotten&force_mssante=1
.
You should pass as argument GETQuery
the text after the ?
.
More from GET queries: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
CodePudding user response:
You can use a ternary operator in the url\
index_content.php?mode=physician&panel=forgotten&force_mssante="
(login_physician_choice == "extern" ? "1" : "0")
it should look like this :
function forgotten() {
if (force_mssante_for_externals) {
$.ajax({
url: "index_content.php?mode=physician&panel=forgotten&force_mssante=" (login_physician_choice == "extern" ? "1" : "0") ",
success: function (html) {
$(".panel-body").html(i18n.tr(html));
$("#rpps").focus();
},
});
}
}