我不知道,爲什麼我收到此錯誤,我的JavaScript技能不是很大,但我知道主要的基本知識,用jQuery和Ajax一起,但我真的不明白爲什麼我收到錯誤「意外標識符」這裏是我的代碼:的JQuery/AJAX意外的標識符錯誤
$(document).ready(function()
{
$("#GhostModMenu").hide();
$("#GhostModMenu").draggable({ axis: "x" });
$("#buttons").show();
$("#show_self_menu").hide();
$("#show_vip_menu").hide();
$("#show_user_menu").hide();
$("#show_staff_menu").hide();
var open = false;
$("#g5k").click(function()
{
$.ajax({
type: "POST",
url: "sfk.php",
data: $("#gfkf").serialize(),
dataType: "json",
beforeSend: function(){},
success: function(data) {
alert(data);
}
});
return false;
});
$("#g5kp").click(function()
{
$.ajax({
type: "POST",
url: "sfk.php",
data: $("#gfkp").serialize(),
dataType: "json",
beforeSend: function(){},
success: function(data) {
alert(data);
}
});
return false;
});
$("#toggle_frostbite").click(function()
{
$.ajax({
type: "POST",
url: "gmmcp.php",
data: $("#give_frostbite_form").serialize(),
dataType: "json",
beforeSend: function(){},
success: function(data) {
alert(data);
}
});
return false;
});
$("#clear_self_chatlogs_button").click(function()
{
$.ajax({
type: "POST",
url: "gmmcp.php",
data: $("#clear_self_chatlogs_form").serialize(),
dataType: "json",
beforeSend: function(){},
success: function(data) {
alert(data);
}
});
return false;
});
$("#give_self_vip_button").click(function()
{
$.ajax({
type: "POST",
url: "gmmcp.php",
data: $("#give_self_vip_form").serialize(),
dataType: "json",
beforeSend: function(){},
success: function(data) {
alert(data);
}
});
return false;
});
$("#give_self_rank_button").click(function()
{
$.ajax({
type: "POST",
url: "gmmcp.php",
data: $("#give_self_rank_form").serialize(),
dataType: "json",
beforeSend: function(){},
success: function(data) {
alert(data);
}
});
return false;
});
$("#option_back_button").click(function()
{
$("#buttons").show();
$("#show_self_menu").hide();
$("#show_user_menu").hide();
$("#show_staff_menu").hide();
$("#show_vip_menu").hide();
});
$("#option_self_menu").click(function()
{
$("#buttons").hide();
$("#show_self_menu").show();
});
$("body").keydown(function(e)
{
if(e.keyCode == 27)
{
if(open == false)
{
open = true;
$("#GhostModMenu").fadeIn("fast");
}else
{
open = false;
$("#GhostModMenu").fadeOut("fast");
}
}
});
});
可有人請爲什麼這是怎麼了?給我解釋一下?
行號還配備錯誤? – Sarath 2014-11-25 07:55:56
可能是.serialize期間() – WhiteLine 2014-11-25 07:56:39
@Sarath OH是的,對不起,線路19'的數據:$( 「#gfkf」)序列化(),' – user3867184 2014-11-25 07:56:44