我对 JavaScript 和 AJAX 非常陌生。一位朋友已经开始帮助我使用一个可以将状态更新发布到App.net的表单,但我无法让它工作。我确定代码中有很多错误,但在此先感谢您的帮助。
<html>
<head>
<title>Post to App.net</title>
<link rel="stylesheet" type="text/css" href="style_post.css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<script>
function post()
</script>
<script type="text/javascript" language="javascript" src="count.js"></script>
<form id="post" method="post">
<textarea name="fixlength" value="What's on your mind?" id="posttext" maxlength="256" lengthcut="true"></textarea><br>
<input type="submit" value="Post" id="submit">
</form>
<label id="limitlbl_0" ><script> parseCharCounts(); </script></label>
<script type="text/javascript">
var frm = $('#post');
var token = window.location.href.substring(45,143),
var text = $('input[type="text"]').val()
frm.submit(function () {
$.ajax({
type: 'POST',
url: 'https://alpha-api.app.net/stream/0/posts',
data: {
text: 'test'
token: + token +'
},
success:
});
return false;
});
</script>
</body>
</html>