Javascript get output from separate php script

后端 未结 2 1935
礼貌的吻别
礼貌的吻别 2021-01-06 02:04

I want javascript to be able to call a php script (which just echos a string) using jQuery.

I think $.get is the right way, but not too sure.

I

2条回答
  •  长发绾君心
    2021-01-06 02:20

    $.get() is the right way.

    $.get('ajax/test.php', function(data) {
      // use the result
      alert(data);
    });
    

提交回复
热议问题