Include PHP file using jQuery or Javascript

前端 未结 2 1415
南旧
南旧 2021-01-19 22:07

I have a Javascript file that submits a form and loads an alert etc. Now I want to add functionality to call or get a .php file, I tried using $.get(\"mai

相关标签:
2条回答
  • 2021-01-19 22:55

    you can use

    $('selector').load() 
    

    OR

    $.ajax();
    

    $.ajax(); is most preferable.

    0 讨论(0)
  • 2021-01-19 22:56

    I think you can try load():

    $("#mailDiv").load('mail.php');
    

    According to me $.get and $.post are to send the data. You cannot include files using this.

    0 讨论(0)
提交回复
热议问题