Ajax post数据

<script type=”text/javascript”>
preAllow = true;
$(function()
{
$(“#btnQ”).click(function(event)
{
if(preAllow){
preAllow=false;
var flag =1
var name = $(“#name”).val();
var phone = $(“#phone”).val();
var activityId = $(“#activityId”).val();
var startTime = $(“#startTime”).val();
var endTime = $(“#endTime”).val();

if(flag){
$.ajax({
type: “POST”,
url: “/”,
data: {“name”:name,”phone”:phone,”activityId”:activityId,”startTime”:startTime,”endTime”:endTime},
success: function(data){
alert(decodeURI(data));
preAllow = true;
}

});
}}
else {alert(“请不要重复点击!”);}
});
})
// ]]></script>