0
   

JavaScript won't wirte spaces

 
 
Reply Sat 17 May, 2014 08:59 pm
I was trying to just pad a space before or after a variale value using document.write but no way, something like this
document.write( " " + i + " "); would never give me a distance b4 or after the rendered value of i. does any one knwo why?
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 463 • Replies: 4
No top replies

 
Zarathustra
 
  1  
Reply Sat 17 May, 2014 10:22 pm
@samy youssef,
White-space is not recognized. Try using the non line-break code
&n bsp; Do not put a space between the n and b. I had to do that to keep it from displaying a blank.
samy youssef
 
  1  
Reply Sun 18 May, 2014 04:46 am
@Zarathustra,
thank u for ur reply I'm going to try this now, actually i tried String.fromCharCode(32) but nothing happened. I appreciate your help
0 Replies
 
samy youssef
 
  1  
Reply Sun 18 May, 2014 05:14 am
@Zarathustra,
Thank u, It worked; but it neede to be enclosed in a single quotes like this but it finally worked '&n bsp;'
Zarathustra
 
  1  
Reply Wed 21 May, 2014 04:41 pm
@samy youssef,
Yes, sorry I assumed you knew that it needed quotes.
0 Replies
 
 

 
  1. Forums
  2. » JavaScript won't wirte spaces
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.02 seconds on 04/24/2024 at 09:55:15