使用prototype AJAX 的post方法~

Javascript 的部份

<script type="text/javascript">
function postNewContact(){
var form = $('form');
var name = $('name');

var url = 'xxx.php';

var myAjax = new Ajax.Request(url,{method:'post',

parameters: Form.serialize(form),

onComplete:showResponse});
}

function showResponse(originalRequest){
alert(originalRequest.responseText);
}
</script>


表單部份

<form method="post" id="form" name="form">
<input type="text" name="name">
</form>



xxx.php檔案

<?
print $HTTP_POST_VARS['name'];
?>

5 則留言:

匿名 說...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

匿名 說...

FawapageDem [url=https://launchpad.net/~codeine-tuco]Buy Codeine no prescription[/url] [url=http://wiki.openqa.org/display/~buy-zithromax-without-no-prescription-online]Buy Zithromax without no prescription online[/url]

匿名 說...

Good Day!!! bittyferrari.blogspot.com is one of the most outstanding innovative websites of its kind. I enjoy reading it every day. bittyferrari.blogspot.com rocks!

匿名 說...

The author of bittyferrari.blogspot.com has written an excellent article. You have made your point and there is not much to argue about. It is like the following universal truth that you can not argue with: One of the funniest things you can do is pack yourself into a suitcase. You will hardly be able to contain yourself. Thanks for the info.

匿名 說...

bittyferrari.blogspot.com is the best. Thank your for this article. I enjoyed it very much.
AAA Toronto Payday Loans 1172 Bay St #101, Toronto, ON M5S 2B4 (416) 477-2817