For Any Javascript Gurus

Ahh... The Chit-Chat forum. Please have all chatting here.

Moderator: The Lounge Moderators

Post Reply
User avatar
nevermindmylife
Loyal
Posts: 613
Joined: Tue Feb 18, 2003 5:54 pm
Contact:

For Any Javascript Gurus

Post by nevermindmylife »

<script language="Javascript"

function ChangeText()

{

pic1.innerHTML = "<img src='pic1.jpg'";

pic2.innerHTML = "<img src='pic2.jpg";

pic3.innerHTML = "<img src='pic3.jpg'";



}



</script

</head

<body onload="ChangeText()"

<font id="pic1"blah1</font



<font id="pic3"blah3</font



okay... for anyone who knows javascript you should be able to figure out what this is supposed to do... but if you don't.. I'll tell you... this is supposed to replace the appropriate text (designated by the id) with something else...

for instance... in my script above... the text "blah1" with the id "pic1" should be replaced by <img src='pic1.jpg'



my problem is, that the code i have works so that every id must be in my html code... or else anything below it won't work...

if you don't get my drift, what I mean is that if I try to have pic3 change without having pic2 or pic1 somewhere before it, it won't change...



I want this code to be able to change everything that I call upon it to change, even if some of the elements are not being used at that moment...



if you don't understand please ask, and I will try my best to explain...



but for those of you who do, your help will be greatly appreciated...

thanks.
*-------- ** ---------** --------*

<span style=\'color:red\'be sure to stay strong

for hope is always coming right along


*-------- ** ---------** --------*
User avatar
Sliver
Veteran
Posts: 2164
Joined: Tue May 20, 2003 11:06 am
Contact:

Re: For Any Javascript Gurus

Post by Sliver »

hmm..... dunno..... wats the

4?
Sliver, A.K.A Tom/Tommy/Tommy Boy (thanks to Lisa and sweethelp)



Moderated with Sweethelp in Bullying forum from Oct 6 2003 to 2006 sometime.



Moderated in the Self Expression Forum and Computer forum mainly, along with the rest of the lounge, until December 2006.



Image
User avatar
four
Veteran
Posts: 4623
Joined: Sun Dec 15, 2002 3:36 am
Contact:

Re: For Any Javascript Gurus

Post by four »

Line break.
NAAM
User avatar
OverDrive
Veteran
Posts: 5172
Joined: Sun Dec 15, 2002 11:53 am
Contact:

Re: For Any Javascript Gurus

Post by OverDrive »

Personally, i have no idea, but use some of the javascript links on my websites link section - http://www.adamj.org/links/#webpage



Got some good javascript pages there - start from the bottom :)
Adam Marshall

HelpingTeens.org Owner

Image Articles Image Resources Image Live Chat Image Support Groups and much more!

Image

I can't think of a better use of server resources... I really can't.
User avatar
Rob
Needs Another Hobby
Posts: 933
Joined: Thu Apr 24, 2003 4:05 pm

Re: For Any Javascript Gurus

Post by Rob »

Your best guess at good help would be http://forums.devshed.com/



Also, are you trying to change text into an image on load? Cause.. I don't think you can do that. Merely only change text into other text. I could be wrong though.
User avatar
Skye
Veteran
Posts: 7194
Joined: Sun Dec 15, 2002 12:48 pm
Contact:

Re: For Any Javascript Gurus

Post by Skye »

You need to randomize the images somehow. You cant just define 3 images. You need to load them into a random array that selects them at random, of course and loads the selected. I'm not really any good with Javascript and I tend to not use it. Your best bet is to go to the forums at http://www.devshed.com.
HelpingTeens.org:

I can't think of a better use of server resources...I really can't.
User avatar
NvMyCougar03
Loyal
Posts: 150
Joined: Wed Aug 27, 2003 1:48 am
Contact:

Re: For Any Javascript Gurus

Post by NvMyCougar03 »

i still dont understand exactly what you want it to do, therefore i cannot help you. try posting on http://www.tunercarz.com/driverforum in the computer help section. i have alot of web programmer friends over there and they are alot better at this then i am.
you may call me "Darkness Within"
Post Reply