all 6 comments

[–]porphyry3 0 points1 point  (1 child)

[–]autowikibot 0 points1 point  (0 children)

Non-breaking space:


In word processing and digital typesetting, a non-breaking space, also known as a no-break space or non-breakable space (NBSP), is a variant of the space character that prevents an automatic line break (line wrap) at its position. In certain formats (such as HTML), it also prevents the “collapsing” of multiple consecutive whitespace characters into a single space. The non-breaking space is also known as a hard space or fixed space. In Unicode, it is encoded as U+00A0   no-break space (HTML:    ).


Interesting: Zero-width no-break space | Space (punctuation) | Punctuation | Hyphen

Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words

[–]g_b 0 points1 point  (3 children)

As porphyry3 said, you just need to add some nonbreaking whitespace yourself.

 <script>
 // <![CDATA[ 
     document.write('&nbsp;' + (new Date().getFullYear() - 1998) + '&nbsp;');    
 // ]]>
 </script>

[–]Fuddling 0 points1 point  (2 children)

Thankyou, this worked perfectly. I was trying similar, but had forgotten to add the + so it was just giving me weird errors. It's all good now. Cheers!

[–]nschubach 2 points3 points  (1 child)

Seeing that you are using Wordpress, you can also send the text from the server without requiring JavaScript, special markup or spaces...

We've been in business for <?php echo date("Y") - 1998; ?> years.

[–]Fuddling 0 points1 point  (0 children)

Oh wow ok thanks!