Показать сообщение отдельно
  #7 (permalink)  
Старый 17.05.2012, 14:53
Аватар для cmd
cmd cmd вне форума
Профессор
Отправить личное сообщение для cmd Посмотреть профиль Найти все сообщения от cmd
 
Регистрация: 19.03.2011
Сообщений: 177

<?

function cecho()
{ 
	echo 'ура';
}
	
if(isset($_POST["a"])){
    cecho();
	exit();
}
?>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function myFirstFunc() 
{
	var aaa = $("#example_j input.first").val();
	var bbb = $("#example_j input.second").val();
	$.ajax({
	  type: "POST",
	  url: "http://localhost/test.php", // тут url твоей страницы
	  data: ({a : aaa, b : bbb}),
	  success: function(data){
			$("#example_j span").text("Выполнено! " + data);
		}
	});
}
</script>
</head>
<body>

<div id="example_j">
<form onsubmit="myFirstFunc(); return false;" method="POST" action="">
	<input type="text" class="first" value="erver" />
	<input class="second" type="text" value="12345" />
	<input type="submit" />
	<span></span>
	<p></p>
</form>
</div>

</body>
</html>
__________________
Cogito, ergo sum
Ответить с цитированием