To show your JavaScript and/or HTML source code:
Save this as js2html.html
PHP Code:
<html>
<head><title>JavaScript to HTML</title>
<script type="text/javascript">
function encode(){
var s = document.getElementById('source');
var txt = s.value;
txt = txt.replace(/[&]/g,'&');
txt = txt.replace(/[<]/g,'<');
txt = txt.replace(/[>]/g,'>');
s.value = txt;
}
</script>
</head>
<body>
<button onclick="encode()">Convert to HTML</button><br />
<textarea id="source" style="width:90%;height:400px"></textarea>
</body></html>
Open js2html.html with your web browser.
Paste in the HTML and/or Javascript code you wish to convert.
Click the convert button ONLY ONCE.
copy and paste the result into the blog.
You may desire to place the output between <pre> and </pre> tags in order to preserve the formatting of the code.
If your aim is to get the script to run on your blog, and you're getting <script> tags then you are not allowed to post JavaScript to your blog. The blog is doing exactly what the code above does... Get a better blog.