wall post using jquery and php


wall post using jquery and php

我想制作用于发表评论的代码,并将其分享给其他人
当我运行此代码并编写注释时,它不会打印任何内容
注意:我从youtube上的一个教程中得到了这段代码。

<html>
<head>
<title>hesham</title>
</head>
<script src="jquery-1.6.1.min.js" type="text/javascript"></script>
<script type="text/javascrpt">
function get()
{
    var input = $('#cmt').val();
    $('#an').prepend(input);
};
</script>
<body>
<form name="frm">
<input type="text" name="cmt" id="cmt" /><input type="button" value="post" onclick="get()" />                 
</form>
<div id="an" style="width:300px">
</div>
</body>
</html>

问题在于:

<script type="text/javascrpt">
                          ^-- // missing the "i"

它拼写错误,有点拼写错误。

更改为:

<script type="text/javascript">

它会起作用的。

(测试)

您也可以将jQuery放在<head></head>中,但是,我的测试无论哪种方式都有效。