Click to See Complete Forum and Search --> : My script adds > for no reason :|


larvantholos
01-19-2003, 07:24 PM
I was wondering if someone might be able to give me some help - I'm a little stumped. I have a menu system setup on my website, but for some reason, when any code get executed for this -

<a href="#" onClick="gal_num = gal_num - 1; if (gal_num < 1){gal_num = 1;}; top.middle.main.document.location=gal_type[gal_select] + gal_nav[gal_num];">previous</a>

An extra > gets inserted in the fickec so if(gale_num <

ends up as if(gal_num><

This small change makes my previous not work. I have a next button defined more or less the same way(except it checks for the last number to not loop over, instead of the first).

I've checked all my code a few times, and the odd part is it used to work, but not it doesn't work on the various places I have it hosted, *grumbles*

If someone could take a look, and point me to the problem, I'd really appreciate it.

Sites http://myplaceofsolitude.dhs.org

The problem is in the bottom frame, the bottom frame interacts with the RIGHT frame(but I'm pretty sure I've ruled out problems caused by the other frame)

-Larvantholos

ShrineDesigns
01-19-2003, 08:33 PM
don't put a function in the onCllick event

<script language="JavaScript">
<!--
function myFunction(gal_num){
if (gal_num > 0){
top.middle.main.document.location=gal_type[gal_select] + gal_nav[gal_num];
}
}
//-->
</script>


<a href="#" onClick="myFunction(1)">previous</a>

larvantholos
01-20-2003, 02:49 AM
Well, that didn't fix it, *grin* but it got me going.. I'll see what I can come up with, thanks.