这是一个脚本,它将文本框的信息发送到另一个页面,信息将被插入到mysql数据库中。
<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
// click to submit an event
$('#Create').click(function(){
var a = $("#EventInput").val();
if(a != "What are you planning?")
{
$.post("concorunt.php?val=1&id=<?php echo $id?>&"+$("#EventForm").serialize(), {
}, function(response){
$('#ShowEvents').prepend($(response).fadeIn('slow'));
clearForm();
});
}
else
{
alert("Enter event name.");
$("#EventInput").focus();
}
});
</script>
但没有发生任何事情。
答案 0 :(得分:0)
您没有关闭文档ready
功能。试试这个:
$(document).ready(function(){
// <![CDATA[ --> Either remove this or close this.
.....
.....
}); //Missing those braces in your code