使用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 則留言:

  1. 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!

    回覆刪除
  2. 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]

    回覆刪除
  3. 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!

    回覆刪除
  4. 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.

    回覆刪除
  5. 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

    回覆刪除