Closed Thread Icon

Preserved Topic: confused (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=15480" title="Pages that link to Preserved Topic: confused (Page 1 of 1)" rel="nofollow" >Preserved Topic: confused <span class="small">(Page 1 of 1)</span>\

 
aok
Obsessive-Compulsive (I) Inmate

From: seattle,wa,98103
Insane since: Apr 2000

posted posted 09-03-2000 17:12

I had a javascript that was working great (thanks to som help from you folks). Well then I started messing around with it, changing pictures and moving tables & now I have errors that I cant seem to fix. Ive gone over & over it. Would someone please take a look and help me? The url is http://www.lousblues.com/test2.html
The code is:
<html>

<head>
<body> <body background="green.jpg" bgcolor="#004400" link="#ffcc66" vlink="#ff9933"
alink"#ffcc99">


<script>
/*Rollover effect on different image script-
/*

function changeimage(towhat,url){
if (document.images){
document.images.targetimage.src=towhat.src
gotolink=url
}
}
function warp(){
window.location=gotolink
}

</script>
<script language="JavaScript1.1">
var myimages=new Array()
var gotolink="#"

function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}

preloadimages("blind.GIF","fictp.JPG","muslog1.GIF","ab.GIF","postc.GIF","crop1.GIF,"coldwt.jpg","crop2.gif")

//myimages[0] would refer to "blind.GIF", myimages[1] would refer to "fictp.JPG",myimages[2] would refer to "muslog1.GIF", myimages[3] would refer to "ab.GIF",
myimages[4] would refer to "postc.GIF",myimages[5] would refer to "crop1.GIF",myimages[6] would refer to "blind.GIF",myimages[7] would refer to "crop2.gif"
</script>
</head>
<center><img src="topt3.JPG"></center>

<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="75%">

<TR>
<TD ALIGN="LEFT" VALIGN="CENTER">

<script>

//myimages[0] would refer to "blind.GIF",myimages[1] would refer to "fictp.JPG",myimages[2] would refer to "muslog1.GIF",
myimages[3] would refer to "ab.GIF",myimages[4] would refer to "postc.GIF",myimages[5] would refer to "crop1.GIF",myimages[6] would refer to "coldwt.jpg",myimages[7] would refer to "crop2.gif" etc
preloadimages("blind.GIF","fictp.JPG",muslog1.GIF","ab.GIF","postc.GIF","crop1.GIF,"coldwt.jpg","crop2.gif")

</script>


<a href="artwork.html" onMouseover="changeimage(myimages[0],this.href)"><img src="1.GIF" border=0></a><br>
<a href="fiction.html" onMouseover="changeimage(myimages[1],this.href)"><img src="2.GIF"border=0></a><br>
<a href="music.html" onMouseover="changeimage(myimages[2],this.href)"><img src="3.GIF" border=0></a><br>
<a href="clasifd.html" onMouseover="changeimage(myimages[3],this.href)"><img src="4.GIF" border=0></a><br>
<a href="postcards.html" onMouseover="changeimage(myimages[4],this.href)"><img src="8.GIF" border=0></a><br>
<a href="guestbook.html" onMouseover="changeimage(myimages[5],this.href)"><img src="5.GIF" border=0></a><br>
<a href="links.html" onMouseover="changeimage(myimages[6],this.href)"><img src="6.GIF" border=0></a><br>
<a href="mailto:lousblues@lousblues.com" onMouseover="changeimage(myimages[7],this.href)"><img src="7.GIF" border=0></a><br>

</TD>

<TD ALIGN="CENTER" VALIGN="TOP">

<a href="javascript:warp()"><img src="frntpict.jpg" name="targetimage" border=0></a>
</TD>

</TR>
</TABLE>

</body>
</html>

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-03-2000 17:58

Oh, it's one simple problem, I think. The lines:

/*Rollover effect on different image script-
/*

Should be:

/*Rollover effect on different image script-
*/

the /* starts the comment and the */ ends it. You had two starting comments, so it got confused when they didn't end.

Fixing that one problem will most likely remove all the errors (or almost all of them).

Jestah
Maniac (V) Mad Scientist

From: Long Island, NY
Insane since: Jun 2000

posted posted 09-03-2000 18:10

wouldnt it have been easier to just use the //

aok
Obsessive-Compulsive (I) Inmate

From: seattle,wa,98103
Insane since: Apr 2000

posted posted 09-03-2000 18:11

Thanks-I fixed that error but still have another one (I am asking myself how I got this so jumbled up) and the rollover effect still isn't working. If you have any ideas please let me know, I am on to my third day of trying to get this to work!

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-03-2000 19:14

True, you could also have used the // comment, which only does one line. /* and */ are useful because they can span more than one line.

Ah, the other error, also very simple:
preloadimages("blind.GIF","fictp.JPG","muslog1.GIF","ab.GIF","postc.GIF","crop1.GIF,"coldwt.jpg","crop2.gif")

should be

preloadimages("blind.GIF","fictp.JPG","muslog1.GIF","ab.GIF","postc.GIF","crop1.GIF","coldwt.jpg","crop2.gif")

You missed a quotation mark after crop1.GIF.

By the way, did you know that if you're using Internet Explorer, and you get a JavaScript error, you can double-click the icon in the lower left of the window, and get the line number that the error's on? That's how I'm pinpointing these so fast.

If you're using Netscape Navigator and you get an error, type "JavaScript:" in the address bar and you can get details on the error.

Remember, always remember to look at the *first* error you get, because one error can cause more errors.

I also just noticed this:

//myimages[0] would refer to "blind.GIF", myimages[1] would refer to "fictp.JPG",myimages[2] would refer to "muslog1.GIF", myimages[3] would refer to "ab.GIF",
myimages[4] would refer to "postc.GIF",myimages[5] would refer to "crop1.GIF",myimages[6] would refer to "blind.GIF",myimages[7] would refer to "crop2.gif"

make sure to put the // for both lines. // comments out just a single line.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 09-03-2000 20:03

one other thing, unrelated to javascript: you seem to have a mix of cases in your file types -- .GIF, .gif, .jpg, .JPG

this will just end up causing confusion in the long run, I'd change them all to lowercase extensions as soon as possible.

little osh
Bipolar (III) Inmate

From: Wales, UK
Insane since: Jun 2000

posted posted 09-04-2000 14:47

That link does evil things to my browser and OS! It comes up saying something like "unknown software exception", and claims to be trying to access some worryingly low memory addresses! It then just closes all browser windows!

Does anyone else have this problem, or is this (as I suspect) yet another item to add to my 'list of complaints to Bill Gates'?

osh

little osh
Bipolar (III) Inmate

From: Wales, UK
Insane since: Jun 2000

posted posted 09-04-2000 14:56

Yep! It's Bill!

It works fine in Netscape!

osh

Jestah
Maniac (V) Mad Scientist

From: Long Island, NY
Insane since: Jun 2000

posted posted 09-04-2000 18:05

Just a suggestion but I think you should crop all your images and make them the same size. Whenever you put your cursor over the Artwork link the page moves down a little bit. Also you should try blending the green in your images a little better with the page or just make them transparent...

Jestah
ieJestah@hotmail.com
ICQ - 77252449

aok
Obsessive-Compulsive (I) Inmate

From: seattle,wa,98103
Insane since: Apr 2000

posted posted 09-04-2000 18:09

Thank you all so much for your help! I finally got it up and running after making the changes you suggested. I will take your advice DL-44 and put my gif/jpgs all in lowercase, I have to tweak my images a bit anyway. Thanks again-you guys are the best!!!!

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-04-2000 20:47

We know! =D

Just kidding =) Glad you got it working.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-06-2000 01:44

aok,

There is something else you should fix. The correct layout for an HTML page is like this:

<html>
<head>
.
. stuff like titles go in the header
.
<script>
.
. scripts go in the header too
.
</script>
</head>

<body>
.
. main page content goes in the body
.
</body>

If you notice in your page you have two body tags in the beginning right after the <head> tag. Make sure you get rid of the first <body> tag and move that second one right after the </head> tag.

The page works fine even with these errors because it totally depends on how the HTML standards are rendered in each individual browser.

Cheers!


aok
Obsessive-Compulsive (I) Inmate

From: seattle,wa,98103
Insane since: Apr 2000

posted posted 09-06-2000 21:26

thanks for the info Bugimus, I will make the changes-wow I've got some repairing to do.
I would like to add a new column to the table and change the java script so that the roll over woulld cause a picture to pop up like it is now and in the third column text that would change with each button. Can anyone tell me how I would do this or point me in the direction of a tutorial? thanks again everyone!

« BackwardsOnwards »

Show Forum Drop Down Menu