简体   繁体   中英

I want to add default text in blogger comment box on my website

Can anyone suggest me to improve my code. By which i can add a default text in my comment box. Please help me. Thank you in advance.

<a href='http://www.blogger.com/comment-iframe.g?blogID=XXXXXXXXXXXXXXXXXXXX&amp;postID=XXXXXXXXXXXXXXXXXXX' id='comment-editor-src' title='comment editor'>
</a>
<iframe class='blogger-iframe-colorize blogger-comment-from-post' height='410' id='comment-editor' name='comment-editor'>
</iframe>
<script type="text/javascript" src="https://www.blogger.com/static/v1/jsbin/2875839671-comment_from_post_iframe.js">
</script>
<script type='text/javascript'>
      BLOG_CMT_createIframe('https://www.blogger.com/rpc_relay.html', 'XXXXXXXXXXXXXXXXXXXX');
</script>
<script type='text/javascript'>
      //<![CDATA[
      if (typeof(jQuery) == 'undefined') {
 //output the script (load it from google api)
 document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\">
</scr" + "ipt>");}
        //]]>
       </script>
<script async='async' src='//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js' type='text/javascript'>
</script>

You can use code below:

var $iframe = $('#comment-editor');
$iframe.ready(function() {
 $iframe.contents().find("body").append('Test');
});

The simplest way would be to use in your iframe a textarea with a your default message within property placeholder .

 <textarea placeholder="Your default message."></textarea> 

The placeholder attribute specifies a short hint that describes the expected value of a text area. The short hint is displayed in the text area before the user enters a value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM