471,054 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,054 software developers and data experts.

\b

Please give me a proper use of switcher \b in command document.write.
My goal is:
1. write a number on a screen
2. restore position of writing one character to the left (backspace)
3. write some else number over first number with overwrite

If I write:

<body>
<script language="JavaScript">
document.write(1, "\b")
document.write(2)
</script>
</body>

I get a rectangle (??) between 1 and 2 like a result in IE v6.0.




Jul 20 '05 #1
1 52987
Lee
Miodrag Stancevic said:

Please give me a proper use of switcher \b in command document.write.


There is no proper use of \b in document.write.

Whatever you write via document.write() is interpretted as HTML.
HTML does not have a backspace character.

You can change the contents of a container:

<html>
<head>
<script type="text/javascript">
function count(){
var myDiv=document.getElementById("alpha");
myDiv.innerHTML=parseInt(myDiv.innerHTML,10)+1;
setTimeout("count()",1000);
}
</script>
<body onload="count()">
<div id="alpha">
0
</div>
</body>
</html>

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.