JRS: In article <zG******************@bignews6.bellsouth.net>, dated
Sat, 8 Apr 2006 02:27:54 remote, seen in news:comp.lang.javascript, Hal
Rosser <hm******@bellsouth.net> posted :
One way is to add another function that will call the first two alternately
and your button calls the new function instead of the other two.:...
var booly = true; //(not in a function)
function thirdFunction(){//**(Call this from the button)
if (booly){
functionOne();
}else{
functionTwo();
}
booly != booly; // **changes booly from true to false or vice-versa
}//*end of function
HTH
Your code is unlikely to help anybody until you learn
(a) javascript,
(b) how to test code before posting it.
There is no assignment operator != (it is relational), and the line
containing it has no effect.
Consider, however
var B = true
...
(B = !B) ? F1() : F2()
or ((B = !B) ? F1 : F2) ()
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.