这是我拥有的javascript和html代码。

function convertinput() {
    document.getElementById('first').value
    var string = document.getElementById('first').value
    var newString = "@@[0:1: " + string + "]]"
    document.getElementById('output').value = newString
}




<input id="first"></input>
<br>
<input id="output"></input>
<br>
<input type='button' onclick='convertinput()' value='convert'>
​


jsfiddle中的代码编辑器是http://jsfiddle.net/FEC7S/3/

我希望此代码显示在我的博客文章中,因为它在这里
http://www.trickiezone.com/2012/10/facebook-blue-text-generator-by.html

如果我通过jsfiddle或tinkerbin将其嵌入我的博客中,则整个网页都会显示出来。
我只需要将结果显示在我的博客文章中。
怎么做?

最佳答案

我在我的博客中添加了工作演示:

signed by miliodiguine

去做:

1)登录到您的博客。

2)添加新帖子

3)粘贴此代码

<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<script language="javascript" type="text/javascript">
function convertinput() {
    document.getElementById('first').value
    var string = document.getElementById('first').value
    var newString = "@@[0:1: " + string + "]]"
    document.getElementById('output').value = newString
}
</script>

<input id="first"></input>
<br>
 <input id="output"></input>
<br>
<input type='button' onclick='convertinput()' value='convert'>
</div>

关于javascript - 在Blogger Post中显示Javascript和HTML的结果,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13122245/

10-14 15:37
查看更多