简体   繁体   English

注释框添加没有html的文本值

[英]Comment Box add text value without html

I have the code for the default comment box from htmlcommentbox.com I'm wondering if it would be possible to assign a text value to the name field of the comment box. 我有来自htmlcommentbox.com的默认评论框的代码。我想知道是否可以将文本值分配给评论框的名称字段。 See the example on http://htmlcommentbox.com If not, is there another comments plugin that gives you the html side of things not just an iframe? 请参阅http://htmlcommentbox.com上的示例。如果没有,是否有另一个评论插件可以为您提供html方面的东西而不仅仅是iframe?

<!-- begin htmlcommentbox.com -->
<div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">Comment Box</a> is              loading comments...</div>
<link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" />
<script type="text/javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={};} (function(){var s=document.createElement("script"), l=(hcb_user.PAGE || ""+window.location), h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src", h+"/jread?page="+encodeURIComponent(l).replace("+","%2B")+"&opts=16862&num=10");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>
<!-- end htmlcommentbox.com -->

Do you mean the gray text that disappears or do you want it to have a starting value? 你是说灰色文本消失了还是你想要它有一个起始值?

For the gray text that disappears when the section is in focus use: 对于使用焦点部分时消失的灰色文本:

placeholder="Whatever you want"

For a starting value use: 对于起始值,请使用:

value="Whatever you want"

Okay add this script above the html comment box and you can make edits to it: 好吧,在html评论框上方添加此脚本,您可以对其进行编辑:

<!-- customize labels of htmlcommentbox.com -->
<script>
// This code goes ABOVE the main HTML Comment Box code!
// replace the text in the single quotes below to customize labels.
hcb_user = {
//L10N
comments_header : 'Comments',
name_label : 'Name',
content_label: 'Enter your comment here',
submit : 'Comment',
logout_link : '<img title="log out" src="//www.htmlcommentbox.com/static/images/door_out.png" alt="[logout]" class="hcb-icon"/>',
admin_link : '<img src="//www.htmlcommentbox.com/static/images/door_in.png" alt="[login]" class="hcb-icon"/>',
no_comments_msg: 'No one has commented yet. Be the first!',
add:'Add your comment',
again: 'Post another comment',
rss:'<img src="//www.htmlcommentbox.com/static/images/feed.png" class="hcb-icon" alt="rss"/> ',
said:'said:',
prev_page:'<img src="//www.htmlcommentbox.com/static/images/arrow_left.png" class="hcb-icon" title="previous page" alt="[prev]"/>',
next_page:'<img src="//www.htmlcommentbox.com/static/images/arrow_right.png" class="hcb-icon" title="next page" alt="[next]"/>',
showing:'Showing',
to:'to',
website_label:'website (optional)',
email_label:'email',
anonymous:'Anonymous',
mod_label:'(mod)',
subscribe:'email me replies',
are_you_sure:'Do you want to flag this comment as inappropriate?',

reply:'<img src="//www.htmlcommentbox.com/static/images/reply.png"/> reply',
flag:'<img src="//www.htmlcommentbox.com/static/images/flag.png"/> flag',
like:'<img src="//www.htmlcommentbox.com/static/images/like.png"/> like',

//dates
days_ago:'days ago',
hours_ago:'hours ago',
minutes_ago:'minutes ago',
within_the_last_minute:'within the last minute',

msg_thankyou:'Thank you for commenting!',
msg_approval:'(this comment is not published until approved)',
msg_approval_required:'Thank you for commenting! Your comment will appear once approved by a moderator.',

err_bad_html:'Your comment contained bad html.',
err_bad_email:'Please enter a valid email address.',
err_too_frequent:'You must wait a few seconds between posting comments.',
err_comment_empty:'Your comment was not posted because it was empty!',
err_denied:'Your comment was not accepted.',

//SETTINGS
MAX_CHARS: 2048,
PAGE:'', // ID of the webpage to show comments for. defaults to the webpage the user is currently visiting.
RELATIVE_DATES:true // show dates in the form "X hours ago." etc.
};
</script>
<!-- done customizing labels of htmlcommentbox.com -->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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