Open ghost opened 6 years ago
Hi, I've checked your code two arguments are swapped, if you switch permlink with first tag everything works fine.
Working example:
<html>
<head><title>steem-js posting example</title></head>
<body>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
Post Function
<script language="JavaScript">
function postArticle()
{
steem.broadcast.comment(
document.getElementById('postingKey').value, // posting wif
document.getElementById('username').value, // author, leave blank for new post
'name-of-my-test-article-post', // permlink
document.getElementById('username').value, // username
'steemtest', // first tag
'', // Title
document.getElementById('article').value, // Body of post
// json metadata (additional tags, app name, etc)
{ tags: ['secondtag'], app: 'steemjs-test!' },
function (err, result) {
if (err)
alert('Failure! ' + err);
else
alert('Success!');
}
);
}
</script>
<h2>Trying to post comment</h2>
Username: <input id="username" type="text"><br/>
Posting key: <input id="postingKey" type="password" size="65"><br/>
Title of article: <input id="title" type="text"><br/>
Article text:<br/>
<textarea id="article"></textarea><br/>
<input id="postIt" type="button" value="Post it!" onClick=postArticle()>
</body>
</html>
wow, amazing, simple thing and I did spend whole on fixing that. Thank you, thank you a lot
I found interesting code that works fine to post into steem
And now I am trying to change that code to make comments for this post. As far as I know but I might be wrong it should something like this:
As far as I did notice you comment posts almost same way as you do create a post. Just remove the title and add the author. But in this case, for some reason, I am getting errors
"RPCError Unknown Key"
Since the author can comment own post I should work with same values. Can anyone know how to fix that problem?