Ciao, è il mio primo post... scusate se dico castronerie...
Ho la stessa necessità di "ricman". In assenza di esperienza ho copiato il vostro codice per vedere come funziona.
Non capisco quello che succede. Mi aspettavo che nell'alert vedessi ciò che ha inviato il form, invece vedo praticamente tutto il codice html della pagina test3.php.
Mi date una mano? Posto il codice così come l'ho "copiato"...
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>prova</title>
<script type="text/javascript" src="/js/jquery.js"></script>
<style type="text/css"></style>
</head>
<body>
<form method="post" action="test3.php?op=edit" id="test3" name="test3">
<input type="text" name="nome">
<input type="submit" value="manda">
</form>
<script type="text/javascript">
$('#test3').submit(function(evt) {
var $form = $(this),
$postdata = $form.serialize(),
$postURI = $form.attr('action');
$.post($postURI, $postdata, function(data) {
alert(data)
});
evt.preventDefault();
});
</script>