Sponsored Content
Top Forums Programming Javascript: displaying images with onchange event Post 302925552 by Akshay Hegde on Monday 17th of November 2014 10:56:45 PM
Old 11-17-2014
Quote:
Originally Posted by figaro
I dont understand this solution. You are declaring an object test that is not actually used for display purposes. This looks very hackish to me:
Code:
img = document.getElementById("test")


I just added attribute id while creating img element for easy access, I have checked for img element with id test, if it doesn't exist already in body, then create img element append to div distribution, else meaning img element with id test, already exists so we don't have to create again, so just access element where id is "test" img = document.getElementById("test"), and change attribute src inside the switch statement. First you try with pictures other than svg ( png, jpeg ), you will be able to view changes, as and when there is a change in dropdown. You will understand better if you could use some debug tool like firebug etc.

Thanks
 

3 More Discussions You Might Find Interesting

1. AIX

where to get .bm or .pm images

I'm just trying to get a personal picture for a backdrop on my AIX user account at work. Where does one acquire the .bm or .pm files. How do I create them as an unpriveledged user? There are quite a few jpeg's that I would like to use. (0 Replies)
Discussion started by: trigggl
0 Replies

2. UNIX for Dummies Questions & Answers

onChange + javascript in perl CGI - question

Hello all, Am trying to include a onChange java script to my perl CGI application which uses POST method to upload files to file_server This is how I embedded javascript in the perl code that renders CGI application print qq| <script type="text/javascript" src="display.js"> </script>... (4 Replies)
Discussion started by: matrixmadhan
4 Replies

3. Shell Programming and Scripting

Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies
img-xbm(n)																img-xbm(n)

__________________________________________________________________________________________________________________________________________________

NAME
img-xbm - Img, X Windows Bitmap Format (xbm) SYNOPSIS
package require Tk package require img::xbm ?1.4? image create photo ?name? ?options? _________________________________________________________________ DESCRIPTION
The package img::xbm is a sub-package of Img. It can be loaded as a part of the complete Img support, via package require Img, or on its own, via package require img::xbm. Like all packages of Img it does not provide new commands, but extends the existing Tk command image so that it supports files containing raster images in the X Windows Bitmap Format (xbm). More specifically img::xbm extends Tk's photo image type. The name of the new format handler is xbm. This handler does not provide additional configuration options. All of the above means that in a call like image create photo ?name? ?options? [1] Image data in xbm format (options -data and -file) is detected automatically. [2] The format name xbm is recognized by the option -format. SEE ALSO
img-bmp, img-dted, img-gif, img-ico, img-intro, img-jpeg, img-pcx, img-pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img- tga, img-tiff, img-window, img-xbm, img-xpm KEYWORDS
image handling, tk, xbm COPYRIGHT
Copyright (c) 1995-2009 Jan Nijtmans <nijtmans@users.sourceforge.net> Img 1.4 img-xbm(n)
All times are GMT -4. The time now is 07:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy