Click here to Skip to main content
15,914,780 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: How to detect .msi file ? Pin
002comp4-Aug-10 1:46
002comp4-Aug-10 1:46 
GeneralRe: How to detect .msi file ? Pin
daveyerwin4-Aug-10 12:26
daveyerwin4-Aug-10 12:26 
GeneralRe: How to detect .msi file ? Pin
002comp4-Aug-10 21:14
002comp4-Aug-10 21:14 
QuestionRefresh Div content Pin
Shantanu Gupta 133731-Jul-10 6:18
Shantanu Gupta 133731-Jul-10 6:18 
AnswerRe: Refresh Div content [modified] Pin
daveyerwin31-Jul-10 7:55
daveyerwin31-Jul-10 7:55 
GeneralRe: Refresh Div content Pin
Shantanu Gupta 133731-Jul-10 19:34
Shantanu Gupta 133731-Jul-10 19:34 
GeneralRe: Refresh Div content [modified] Pin
daveyerwin1-Aug-10 3:15
daveyerwin1-Aug-10 3:15 
QuestionDisplay image on refresh with link Pin
Dave McCool30-Jul-10 14:39
Dave McCool30-Jul-10 14:39 
I am trying to, on my homepage show just a sample of what is on my website using a certian number of images. The code I have already is (found code online):

Code in header:

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'Images/Nepticulidae/Stigmella_Aurella/Stigmella_aurella_Adult1.jpg'
theImages[1] = 'Images/Lasiocampidae/Drinker/Drinker_Moth_Adult_Male1.jpg'
theImages[2] = 'Images/Geometridae/Pale%20Brindled%20Beauty/Pale_Brindled_Beauty_Tree.jpg'
theImages[3] = 'Images/Noctuidae/Cuculliinae/Early%20Grey/earlygrey_Rossa.jpg'
theImages[4] = 'Images/Noctuidae/The%20Satellite/Satellite_Yellow_Stigma1.jpg'
theImages[5] = 'Images/Nymphilidae/Painted_Lady/Painted_Lady_Road.jpg'
theImages[6] = 'Images/Nymphilidae/Small_Heath/Small_Heath_Resting1.jpg'
theImages[7] = 'Images/Nymphilidae/Meadow_Brown/Irish/Meadow_Brown_Flower.jpg'
theImages[8] = 'Images/Nymphilidae/Owl%20Butterflys/Caligo_Menom/Owl_Butterfly_Resting.jpg'
theImages[9] = 'Images/Pterophoridae/Stenoptilia_pterodactyla/Stenoptilia_pterodactyla_Adult1.jpg'
theImages[10] = 'Images/Pyralidae/Chrysoteuchia%20culmella/Chrysoteuchia_culmella_Adult2.jpg'
theImages[11] = 'Images/Sphinigidae/Eyed_Hawk_Moth/Eyed_Hawk_Moth_Resting1.jpg'
theImages[12] = 'Images/Tortricidae/Tortricinae/Syndemis%20musculana/Syndemis_musculana_Mating.JPG'
theImages[13] = 'Images/Unusual%20Moths/Tony%20Kingston/Popular%20Hawkmoth/Popular%20Hawkmoth%201.jpg'
theImages[14] = 'Images/Unusual%20Moths/Roger%20Skeen/Oleander_Hawk_Moth1.jpg'
theImages[15] = 'Images/Unusual%20Moths/Roger%20Skeen/Bastilla_crameri.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->
</script>



Code placed where I want the images displayed:

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
showImage();
//  End -->
</script>


Because my website is about butterflies and moths, when the image of a species appears, I would like below the image text saying what the species is and when you click the text (want text to be hyperlink), it takes you to a page about that species, target frame for the hyperlink is _self

Anyone know how I could do this?

David McCormick
In the end we're all just the same

AnswerRe: Display image on refresh with link [modified] Pin
daveyerwin30-Jul-10 17:47
daveyerwin30-Jul-10 17:47 
Questionvalidation using jscript Pin
Thanusree Duth29-Jul-10 18:48
Thanusree Duth29-Jul-10 18:48 
Answer[Cross-Post] validation using jscript Pin
Sandeep Mewara29-Jul-10 19:17
mveSandeep Mewara29-Jul-10 19:17 
GeneralRe: [Cross-Post] validation using jscript Pin
Thanusree Duth29-Jul-10 19:20
Thanusree Duth29-Jul-10 19:20 
Questionvalidation Pin
Thanusree Duth29-Jul-10 17:43
Thanusree Duth29-Jul-10 17:43 
Answer[Cross-Post] validation Pin
Sandeep Mewara29-Jul-10 19:16
mveSandeep Mewara29-Jul-10 19:16 
QuestionWell, soneone's gotta go first... Pin
NeverHeardOfMe22-Jul-10 9:14
NeverHeardOfMe22-Jul-10 9:14 
AnswerRe: Well, soneone's gotta go first... [modified] Pin
daveyerwin22-Jul-10 12:33
daveyerwin22-Jul-10 12:33 
GeneralRe: Well, soneone's gotta go first... [modified] Pin
NeverHeardOfMe22-Jul-10 12:45
NeverHeardOfMe22-Jul-10 12:45 
GeneralRe: Well, soneone's gotta go first... Pin
daveyerwin22-Jul-10 13:01
daveyerwin22-Jul-10 13:01 
AnswerRe: Well, soneone's gotta go first... Pin
mmagill04-Aug-10 6:57
mmagill04-Aug-10 6:57 
GeneralRe: Well, soneone's gotta go first... Pin
NeverHeardOfMe4-Aug-10 7:43
NeverHeardOfMe4-Aug-10 7:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.