Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Setting background image of table column

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

I am currently facing some problems with setting the background of the column with an image object. I wonder is there even a way to do this?
Now i am doing this:

document.getElementById(3).style.background = "url('images/m2_last.png')";

Trying to do smth like this:

document.getElementById(3).style.background = "data:image/jpeg;base64,"+ vector.get(0);

Thanks for all your help in advance
[ July 26, 2006: Message edited by: Yans Tan ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks an aweful lot like HTML to me. Moving to the HTML / Javascript forum.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.getElementById(3).style.background = "url('images/m2_last.png')";

The only problem I see in this is the 3. Is that really the id of the element?

 
Yans Tan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

Yes I that is my element id. Bad naming though. Anyway, any idea about the second part? I found some new methods of doing it, but still not what i wanted.

Method found:
document.getElementById("myImage").src="hackanm.gif"

What I wanted:
document.getElementById("myImage").src= myImageObject
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic