Executing a php script in javascript?

后端 未结 3 2115
南旧
南旧 2021-01-17 05:23

I\'m trying to run a quick php script when users leave my website, and also pass a variable from my javascript to php but i\'m not quite sure how to include the php file and

3条回答
  •  长情又很酷
    2021-01-17 06:03

    Try an ajax request. Depending on your php script you will need $.post or $.get

    jQuery:

    
    

    EDIT:

    Your php script should reference the $_POST array if you use my code above.

    
    

提交回复
热议问题