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

style.backgroundImage + mozilla

P: 15
Hey guys, I can't figure out this problem. My code works perfectly in IE but it won't show in mozilla. Any assistance will be helpful.
Expand|Select|Wrap|Line Numbers
  1. var TableObj = document.getElementById("backgroundi");
  2. if (TableObj && TableObj.style) {
  3.     TableObj.style.backgroundImage =
  4.     'url(somepath)';
  5. }
  6.  
The Error mozilla is giving is:
Warning: Error in parsing value for property 'background-image'. Declaration dropped.
Source File: http://localhost/Cal/code/calander.html
Line: 0
Jun 21 '07 #1
Share this Question
Share on Google+
6 Replies


rnd me
Expert 100+
P: 427
'url(somepath)';


is invalid.
use the plain relative filename instead of the CSS URI selector.
Jun 21 '07 #2

P: 15
That doesn't work, now it don't work in either IE nor Mozilla
Expand|Select|Wrap|Line Numbers
  1. var TableObj = document.body;
  2. if (TableObj && TableObj.style) {
  3. TableObj.style.backgroundImage = "C:/Program Files/EasyPHP1-8/www/NewTCL/tclLogo.gif";
  4. }
  5.  
This is EXACTLy what I have
Jun 21 '07 #3

acoder
Expert Mod 15k+
P: 16,027
'url(somepath)';


is invalid.
use the plain relative filename instead of the CSS URI selector.
It is valid. See link.
Jun 22 '07 #4

acoder
Expert Mod 15k+
P: 16,027
That doesn't work, now it don't work in either IE nor Mozilla
Expand|Select|Wrap|Line Numbers
  1. var TableObj = document.body;
  2. if (TableObj && TableObj.style) {
  3. TableObj.style.backgroundImage = "C:/Program Files/EasyPHP1-8/www/NewTCL/tclLogo.gif";
  4. }
  5.  
This is EXACTLy what I have
This is not going to work because it's referencing a local file. Use the previous url syntax but with a path relative to your website/localhost.
Jun 22 '07 #5

P: 15
Thanks! That worked, I don't know why I didn't notice that.
Jun 22 '07 #6

acoder
Expert Mod 15k+
P: 16,027
No problem. You're welcome.
Jun 22 '07 #7

Post your reply

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