open_ajax.php
Kod
<script src="js/jQuery.js"></script>
<script>
function ajax(url, name)
{
$.post(url, { ajax: name });
}
</script>
<?php
print "<span style='cursor: pointer;' onclick='ajax(\"ajax.php\", \"asd\")'>
<img src='images/budynek.PNG' border='0'>
</span><br>
include("ajax.php");
<script>
function ajax(url, name)
{
$.post(url, { ajax: name });
}
</script>
<?php
print "<span style='cursor: pointer;' onclick='ajax(\"ajax.php\", \"asd\")'>
<img src='images/budynek.PNG' border='0'>
</span><br>
include("ajax.php");
ajax.php
Kod
<?php
if(isset($_POST['ajax']))
{
print "
<div>
aaaaaaaaaaaaaaaaaaaaaa
</div>";
}
?>
if(isset($_POST['ajax']))
{
print "
<div>
aaaaaaaaaaaaaaaaaaaaaa
</div>";
}
?>