Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>2 javascript functions clashing...

2 javascript functions clashing...

Hi I'm hoping someone may be able to help. I'm building a site for a kayaking pal. I had set out to make it accessible, but now have added a couple of javascript functions (both shareware). I am not very familiar with javascript, but it seems the functions are clashing with one another. I have one which controls the speed of the page movement and another which controls the calendar. All working fine, unless you click on a month to change the calendar date first, which then takes you back to the menu instead of changing the date. If you select the 'show current date' first and then change the month it works fine. Unfortunately I have no idea why. Could anyone be kind enough to have a look see for me?

Would be ever so grateful.

http://www.ukrenewables.com/squirt/the_only_page.htm

Sarah

Your problem is that you have two onload statements, and the second over-writes the first.

<script type="text/javascript" src=http://codingforums.com/archive/index.php/"js/thw.js" onload="HtinyScrolling.init();"></script>

<body onload="changedate('return'); HtinyScrolling.init(); scrollTips.init();">
<div id="page">

For the solution to this see:-

http://www.javascriptkit.com/javatutors/multiplejava.shtml

But you may have another problem. You may not have two or more functions or variables with the same names ( one clashes with the other).
check this out (espcially variables named 'x', 'c' and so forth).

Many thanks Philip I'll give that a whirl.
Sarah


 

TOP

Hyperthreading hurts s
HP sharpens blade PC l
Apple goes for Quad po
Itanium gets scaled do

For more info

HP sharpens blade PC l
Hyperthreading hurts s
can not call click() i
script does not work o
smart menu 
write to an html file 
FireFox doesn't recogn
Changing e.keyCode (e.
Clearing a range creat
UPDATE: My mouse over 

News Archive

onChange Help 
beforeload? vs onload.
Problem with document.
decreasing my javascri
Problem with \\ and \ 
how to stop scrolling?
Change Label Text Colo
Can I forward a page b
2 javascript functions
Validating a textbox 

Related stories:

onChange Help
beforeload? vs onload.
Problem with document.ignore in javascript
decreasing my javascript
Problem with \\ and \
how to stop scrolling?
Change Label Text Color and Its Shade of Disabled Buttons
Can I forward a page by the URL used to get to it?
Validating a textbox

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics