game/ajax.php

20 lines
544 B
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
if(isset($_GET['test'])) {
2023-01-10 16:29:32 +00:00
echo 'Тест 5<br>'.$_GET['test'].'<br>'.$_POST['test_post'].'';
2022-06-06 21:30:34 +00:00
die();
}
2023-01-10 16:29:32 +00:00
echo 'Тест 1<br>';
2022-06-06 21:30:34 +00:00
?>
<script src="/js/jquery.js" type="text/javascript"></script>
2022-06-06 21:30:34 +00:00
<script>
function test() {
2023-01-10 16:29:32 +00:00
$('#test_side').html( 'Тест 3' );
$.post('/ajax.php?test=Тест 6&',{'test_post':'Тест7'},function(data){ $('#test_block').html( data ); });
2022-06-06 21:30:34 +00:00
}
</script>
2023-01-10 16:29:32 +00:00
Тест 2<br>
2022-06-06 21:30:34 +00:00
<div id="test_side"></div>
<div id="test_block"></div>
<br><br>
2023-01-10 16:29:32 +00:00
<a href="javascript:test();">Протестировать запрос</a>