By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,932 Members | 1,468 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,932 IT Pros & Developers. It's quick & easy.

escape 'space' character in javascript

P: 63
I have used following code
Expand|Select|Wrap|Line Numbers
  1. onmouseover=rollOver("'.$rolloverImage.'","imgPlaceHolder","'.$dimension.'")
$rolloverImage may contain the filename with space character. Because of the space character the html is not rendered properly.
For example
Expand|Select|Wrap|Line Numbers
  1. onmouseover='rollOver("images/Blue' hills.jpg="" imgplaceholder="" ,="" 300,400="" )=""
I have tried to replace space character with '%20' but doesn't work.
Is there any other way?
Nov 30 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
I may be wrong, but I don't think it's the space that's causing the problem. It seems like it's the single quote. You may have got them mixed up.

Post the rest of the relevant code.
Dec 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.