Calling PHP scripts from Javascript without leaving current page

前端 未结 7 1365
别跟我提以往
别跟我提以往 2021-01-18 14:57

I\'m having some trouble calling PHP scripts from Javascript without leaving the current HTML page (if it is at all possible). I understand it is possible using AJAX, althou

7条回答
  •  既然无缘
    2021-01-18 15:55

    If you do not want to include the jquery library you can simple do the following

    a) ad an iframe, size 0px so it is not visible, href is blank

    b) execute this within your js code function

     window.frames['iframename'].location.replace('http://....your . php');
    

    This will execute the php script and you can for example make a database update...

提交回复
热议问题