skip to Main Content

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 ?????????????

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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();
                },
            });
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search