什么都没有用$。员额的jQuery不会与POST方法发送
function clicked()
{
var $contact_title=$("#contact_title");
var $contact_summary=$("#bbcode");
alert($contact_title.val());// How do I get the contents of the title
alert($contact_summary.val());// How do I get the contents of the textarea
$.post('jquery_send_admin.php',{ title:$contact_title, content:$contact_summary }, function(data){ alert("Message was sent") }, 'html');
}
我得到的例外在我的控制台error..like以下发下一页..为什么?!?
if(isset($_POST["title"]) && isset($_POST["content"]))
{
$title=mysql_escape_string($_POST["title"]);
$content=mysql_escape_string($_POST["content"]);
$result=mysql_query("INSERT INTO users (query_title,query_message) VALUES(''$title', '$content')") or die(mysql_error());
}
以下错误发生:
Error: uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js :: <TOP_LEVEL> :: line 16" data: no]
UPDATE: 那是什么我从页,这是由jQuery的触发要求:
<?php
echo 'outside';
if(isset($_POST["title"]) && isset($_POST["content"]))
{
echo 'inside';
$title=mysql_escape_string($_POST["title"]);
$content=mysql_escape_string($_POST["content"]);
$result=mysql_query("INSERT INTO users (query_title,query_message) VALUES(''$title', '$content')") or die(mysql_error());
}
?>
为什么我不明白任何东西放在下一页?!? –
@DmitryMakovetskiyd,你在说什么下一页?你期望在下一页得到什么?你究竟得到了什么? –
在我的更新中,正如你在我的更新中看到的那样,我试图插入数据..并且hte警报消息在最后被触发。为什么? –