call php page under Javascript function

前端 未结 5 1952
别跟我提以往
别跟我提以往 2021-01-21 09:52

Is it Possible to call php page under Javascript function? I have an javascript function and I want to call php page if someone press okk

Here is my code so far

<
5条回答
  •  无人及你
    2021-01-21 10:33

    if you want to redirect to a page:yourphppage.php if the user pressed ok.

     function show_confirm()
     {
          var r=confirm("Do You Really want to Refund money! Press ok to Continue ");
          if (r==true)
            {
            window.location="yourphppage.php";
            return true;
            }
               else
            {
            alert("You pressed Cancel!");
            }
     }
    

提交回复
热议问题