#!/usr/bin/perl
print "Content-type: text/html \n\n";
print qq(<html>
<head>
<script type="text/javascript" src="/jquery.js"></script>
<script>
jQuery(document).ready(function(){
jQuery("#form_lang").submit(function(e){
var str = jQuery(this).serialize();
alert("dfdaf");
jQuery.ajax({
type: "POST",
url:"contacts.pl",
success: function(){
jQuery("#note").ajaxComplete(function(event, request, settings){
if(msg == 'OK')
alert("Your message!");
});
},
});
});
});
</script>
</head>
这是表格部分:
<form id ="form_lang" action="helloworld.pl" method="POST">
<p>Enter Language: </p>
<input type="text" id="lang" name="lang" /><br/>
<p>Enter Description: </p>
<textarea id="lang_desc" name="lang_desc" ></textarea><br/>
<input type="submit" value="submit" />
在这里,控件上升到警报(“dfdaf”)。之后它被提交给 helloworld.pl...contacts.pl 没有被引用..Y 是吗?那怎么打电话呢?提前感谢