Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: HTML/Javascripting and variables?  (Read 1189 times)

0 Members and 1 Guest are viewing this topic.
HTML/Javascripting and variables?
« on: September 07, 2008, 02:19:54 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 29
Hi.  In HTML or Javascript (or something else I dunno whatelse there is o_O) is it possible to define an image as like, a variable?  See, I want to make something that reuses three different images over and over (it's a chart that uses a checkmark, x, and a question mark).  Basically, is it possible to define a way for an image to be used, such as a keyword or something, instead of having to do <img src = "blah.yay">?
Logged
  • _D_W_ RP Archives
Re: HTML/Javascripting and variables?
« Reply #1 on: September 07, 2008, 10:14:05 am »
  • The Dark Lord is here...
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 29
Code: [Select]
<div id="something"><image src="blah.yay"></div>
Logged
Darth RPG - Feel Dark Side temptation

  • The Legend of Cerda Website

mit

Re: HTML/Javascripting and variables?
« Reply #2 on: September 07, 2008, 07:28:59 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
You want to have it insert the image code on queue? You could just define a function that inserts it and calls that.


If you want to change the image src dynamically you need to give the image an id and refer to it through that, or put all the code in the image tag's events and use this.src=...
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.017 seconds with 44 queries.